Abstract base — host-callable audio source. More...
#include <source.hpp>
Public Member Functions | |
| virtual | ~AudioSource ()=default |
| virtual void | prepare_to_play (int samples_per_block_expected, double sample_rate)=0 |
| Called before playback begins. | |
| virtual void | release_resources ()=0 |
| Called when playback is finished. | |
| virtual void | get_next_audio_block (BufferView< float > out, int start_sample, int num_samples)=0 |
| Fill num_samples of out, starting at start_sample within out. | |
Abstract base — host-callable audio source.
Lifecycle: prepare_to_play(block_size, sample_rate) is called once before audio starts; release_resources() once after audio stops. Between them, get_next_audio_block() is called per audio block. All three must be safe to call from the audio thread (no allocations after prepare_to_play).
|
virtualdefault |
|
pure virtual |
Fill num_samples of out, starting at start_sample within out.
The source writes (not adds) into the range so callers don't need to pre-zero.
Implemented in pulp::audio::AudioFormatReaderSource, and pulp::audio::AudioTransportSource.
|
pure virtual |
Called before playback begins.
samples_per_block_expected is the maximum block length the host will ever ask for; implementations may allocate scratch buffers of that size here.
Implemented in pulp::audio::AudioFormatReaderSource, and pulp::audio::AudioTransportSource.
|
pure virtual |
Called when playback is finished.
Implementations should free any buffers allocated in prepare_to_play.
Implemented in pulp::audio::AudioFormatReaderSource, and pulp::audio::AudioTransportSource.