Struct std::AudioBuffer
struct AudioBuffer {
Fixed data[AUDIO_BUF_FRAMES * AUDIO_MAX_CHANNELS];
unsigned long cap_frames;
unsigned long channels;
volatile unsigned long head;
volatile unsigned long tail;
}Fields
capacity in frames
number of channels (1=mono, 2=stereo, …)
write head (frames)
read head (frames)
Methods
Frames available to read.
Frames available to write.
Write the frames in src (as many as fit). Returns frames written.
Read up to dst.len / channels frames into dst. Returns frames read.
Like read_frames, without consuming.
Mix (add) the frames in src into the next writable frames.
Used for audio mixing; does not advance head. Returns frames mixed.
Clear (zero) all frames.
An empty buffer of 'channels' channels (capacity = AUDIO_BUF_FRAMES frames), zeroed.