Sound recorder. More...
#include <Recorder.h>
Public Member Functions | |
Recorder (int channels=1, int frames=8192) | |
int | channels () const |
Get number of recording channels. | |
int | frames () const |
Get number of multi-channel recording frames. | |
int | size () const |
Get total number of samples (frames x channels) in buffer. | |
void | overwrite (float v, int chan) |
Write sample into ring buffer without advancing write tap. | |
void | write (float v, int chan=0) |
Write sample into ring buffer and advance write tap. | |
void | write (float v1, float v2, int chan=0) |
int | read (float *&buf) |
Empty buffer of most recent samples written from audio thread. | |
void | resize (int chans, int frames) |
Resize buffers. |
Sound recorder.
Recorder | ( | int | channels = 1 , |
int | frames = 8192 |
||
) |
[in] | chans | number of channels |
[in] | frames | number of (multi-)channel frames |
int read | ( | float *& | buf | ) |
Empty buffer of most recent samples written from audio thread.
Returns number of frames copied to buffer. If the number of frames returned is 0, then no samples were read and 'buf' is unmodified. This should be called from a lower priority thread.
void resize | ( | int | chans, |
int | frames | ||
) |
Resize buffers.
[in] | chans | number of channels |
[in] | frames | number of (multi-)channel frames |
void write | ( | float | v1, |
float | v2, | ||
int | chan = 0 |
||
) |
Write samples into ring buffer and advance write tap Call this from the audio thread