25 lines
644 B
C
Raw Normal View History

2019-10-26 01:51:40 +02:00
#pragma once
#include <functional>
#include <cstdio>
namespace tc::audio {
class Reframer {
public:
Reframer(size_t channels, size_t frame_size);
virtual ~Reframer();
2019-10-26 01:51:40 +02:00
void process(const void* /* source */, size_t /* samples */);
2019-10-26 01:51:40 +02:00
inline size_t channels() const { return this->_channels; }
inline size_t frame_size() const { return this->_frame_size; }
2019-10-26 01:51:40 +02:00
std::function<void(const void* /* buffer */)> on_frame;
private:
void* buffer;
size_t _buffer_index;
2019-10-26 01:51:40 +02:00
size_t _channels;
size_t _frame_size;
};
2019-10-26 01:51:40 +02:00
}