Async
0.18.0
|
A class for creating a wide range of audio filters. More...
#include <AsyncAudioFilter.h>
Public Member Functions | |
AudioFilter (const std::string &filter_spec, int sample_rate=INTERNAL_SAMPLE_RATE) | |
Constuctor. More... | |
~AudioFilter (void) | |
Destructor. More... | |
void | setOutputGain (float gain) |
Set the output gain of the filter. More... | |
void | reset (void) |
Reset the filter state. More... | |
![]() | |
AudioProcessor (void) | |
Default constuctor. More... | |
virtual | ~AudioProcessor (void) |
Destructor. More... | |
int | writeSamples (const float *samples, int len) |
Write audio to the filter. More... | |
void | flushSamples (void) |
Order a flush of all samples. More... | |
void | resumeOutput (void) |
Resume output to the sink if previously stopped. More... | |
void | allSamplesFlushed (void) |
All samples have been flushed by the sink. More... | |
![]() | |
AudioSink (void) | |
Default constuctor. More... | |
virtual | ~AudioSink (void) |
Destructor. More... | |
bool | registerSource (AudioSource *source) |
Register an audio source to provide samples to this sink. More... | |
void | unregisterSource (void) |
Unregister the previously registered audio source. More... | |
bool | isRegistered (void) const |
Check if an audio source has been registered. More... | |
AudioSource * | source (void) const |
Get the registered audio source. More... | |
![]() | |
AudioSource (void) | |
Default constuctor. More... | |
virtual | ~AudioSource (void) |
Destructor. More... | |
bool | registerSink (AudioSink *sink, bool managed=false) |
Register an audio sink to provide samples to. More... | |
void | unregisterSink (void) |
Unregister the previously registered audio sink. More... | |
bool | isRegistered (void) const |
Check if an audio sink has been registered. More... | |
AudioSink * | sink (void) const |
Get the registered audio sink. More... | |
bool | sinkManaged (void) const |
Check if the sink is managed or not. More... | |
void | handleAllSamplesFlushed (void) |
The registered sink has flushed all samples. More... | |
Protected Member Functions | |
void | processSamples (float *dest, const float *src, int count) |
Process incoming samples and put them into the output buffer. More... | |
![]() | |
void | setInputOutputSampleRate (int input_rate, int output_rate) |
Set the input and output sample rates. More... | |
![]() | |
void | sourceResumeOutput (void) |
Tell the source that we are ready to accept more samples. More... | |
void | sourceAllSamplesFlushed (void) |
Tell the source that all samples have been flushed. More... | |
bool | setHandler (AudioSink *handler) |
Setup another sink to handle the incoming audio. More... | |
void | clearHandler (void) |
Clear a handler that was previously setup with setHandler. More... | |
AudioSink * | handler (void) const |
![]() | |
int | sinkWriteSamples (const float *samples, int len) |
void | sinkFlushSamples (void) |
bool | setHandler (AudioSource *handler) |
Setup another source to handle the outgoing audio. More... | |
AudioSource * | handler (void) const |
void | clearHandler (void) |
Clear a handler that was previously setup with setHandler. More... | |
A class for creating a wide range of audio filters.
Definition at line 113 of file AsyncAudioFilter.h.
|
explicit |
Constuctor.
filter_spec | The filter specification |
sample_rate | The sampling rate |
Async::AudioFilter::~AudioFilter | ( | void | ) |
Destructor.
|
protectedvirtual |
Process incoming samples and put them into the output buffer.
dest | Destination buffer |
src | Source buffer |
count | Number of samples in the source buffer |
This function is called from the base class to do the actual processing of the incoming samples. All samples must be processed, otherwise they are lost and the output buffer will contain garbage.
Implements Async::AudioProcessor.
void Async::AudioFilter::reset | ( | void | ) |
Reset the filter state.
|
inline |
Set the output gain of the filter.
gain | The gain to set |
Definition at line 133 of file AsyncAudioFilter.h.