27 lines
553 B
C
27 lines
553 B
C
|
#pragma once
|
||
|
|
||
|
#include <functional>
|
||
|
#include <cstdio>
|
||
|
|
||
|
namespace tc {
|
||
|
namespace audio {
|
||
|
class Reframer {
|
||
|
public:
|
||
|
Reframer(size_t channels, size_t frame_size);
|
||
|
virtual ~Reframer();
|
||
|
|
||
|
void process(const void* /* source */, size_t /* samples */);
|
||
|
|
||
|
inline size_t channels() { return this->_channels; }
|
||
|
inline size_t frame_size() { return this->_frame_size; }
|
||
|
|
||
|
std::function<void(const void* /* buffer */)> on_frame;
|
||
|
private:
|
||
|
void* buffer;
|
||
|
size_t _buffer_index;
|
||
|
|
||
|
size_t _channels;
|
||
|
size_t _frame_size;
|
||
|
};
|
||
|
}
|
||
|
}
|