arduino-audio-tools
|
Audio Source Interface - Contract for Audio Data Providers. More...
#include <IAudioSource.h>
Public Member Functions | |
virtual RTSPFormat & | getFormat ()=0 |
Get the audio format configuration. | |
virtual int | readBytes (void *dest, int maxSamples)=0 |
Read audio data into provided buffer. | |
virtual void | start () |
Initialize audio source for streaming. | |
virtual void | stop () |
Cleanup audio source after streaming. | |
Audio Source Interface - Contract for Audio Data Providers.
|
pure virtual |
Get the audio format configuration.
Returns the RTSPFormat object that describes the audio data characteristics including sample rate, bit depth, number of channels, and RTP packaging parameters. If no format has been explicitly set, creates a default 16-bit PCM format at 16kHz mono.
Implemented in RTSPAudioSource.
|
pure virtual |
Read audio data into provided buffer.
This is the core method that provides audio data to the streaming system. Implementation should fill the destination buffer with audio samples in the format specified by getFormat(). The method should be non-blocking and return available data immediately.
dest | Pointer to buffer where audio data should be written |
maxBytes | Maximum number of bytes that can be written to dest buffer |
Implemented in RTSPAudioSource.
|
inlinevirtual |
Initialize audio source for streaming.
Called when streaming is about to begin. Implementations should use this to initialize hardware, allocate buffers, start audio capture, or perform any other setup required for audio data generation.
Reimplemented in RTSPAudioSource.
|
inlinevirtual |
Cleanup audio source after streaming.
Called when streaming has ended. Implementations should use this to release hardware resources, deallocate buffers, stop audio capture, or perform cleanup operations.
Reimplemented in RTSPAudioSource.