AudioBuffer
AudioBuffer
#include <icy/av/audiobuffer.h>struct AudioBufferDefined in src/av/include/icy/av/audiobuffer.h:31
FIFO buffer for queuing audio samples between encoding stages.
List of all members
| Name | Kind | Owner |
|---|---|---|
fifo | variable | Declared here |
AudioBuffer | function | Declared here |
~AudioBuffer | function | Declared here |
AudioBuffer | function | Declared here |
operator= | function | Declared here |
AudioBuffer | function | Declared here |
operator= | function | Declared here |
alloc | function | Declared here |
reset | function | Declared here |
close | function | Declared here |
write | function | Declared here |
read | function | Declared here |
available | function | Declared here |
Public Attributes
| Return | Name | Description |
|---|---|---|
AVAudioFifo * | fifo | Underlying FFmpeg audio FIFO handle. |
fifo
AVAudioFifo * fifoDefined in src/av/include/icy/av/audiobuffer.h:71
Underlying FFmpeg audio FIFO handle.
Public Methods
| Return | Name | Description |
|---|---|---|
AudioBuffer | ||
AudioBuffer | Deleted constructor. | |
AudioBuffer | Deleted constructor. | |
void | alloc | Allocate the audio FIFO buffer. |
void | reset | Discard all samples currently held in the FIFO without freeing the buffer. |
void | close | Free the underlying AVAudioFifo buffer. |
void | write | Write samples into the FIFO buffer. |
bool | read | Read samples from the FIFO buffer. |
int | available const | Return the number of samples per channel currently available in the FIFO. |
AudioBuffer
AudioBuffer()Defined in src/av/include/icy/av/audiobuffer.h:33
AudioBuffer
AudioBuffer(const AudioBuffer &) = deleteDefined in src/av/include/icy/av/audiobuffer.h:36
Deleted constructor.
AudioBuffer
AudioBuffer(AudioBuffer &&) = deleteDefined in src/av/include/icy/av/audiobuffer.h:38
Deleted constructor.
alloc
void alloc(const std::string & sampleFmt, int channels, int numSamples = 1024)Defined in src/av/include/icy/av/audiobuffer.h:46
Allocate the audio FIFO buffer.
Parameters
sampleFmtThe sample format name (e.g. "s16", "fltp").channelsThe number of audio channels.numSamplesThe initial buffer capacity in samples per channel.
reset
void reset()Defined in src/av/include/icy/av/audiobuffer.h:49
Discard all samples currently held in the FIFO without freeing the buffer.
close
void close()Defined in src/av/include/icy/av/audiobuffer.h:52
Free the underlying AVAudioFifo buffer.
write
void write(void ** samples, int numSamples)Defined in src/av/include/icy/av/audiobuffer.h:58
Write samples into the FIFO buffer.
Parameters
samplesArray of per-channel sample buffers.numSamplesThe number of samples per channel to write.
read
bool read(void ** samples, int numSamples)Defined in src/av/include/icy/av/audiobuffer.h:65
Read samples from the FIFO buffer.
Parameters
samplesArray of per-channel sample buffers to fill.numSamplesThe number of samples per channel to read.
Returns
True if enough samples were available.
available
const
int available() constDefined in src/av/include/icy/av/audiobuffer.h:69
Return the number of samples per channel currently available in the FIFO.
Returns
The number of available samples, or zero if the buffer is not allocated.
