Async 1.8.0
|
An audio pipe class to clip audio to a given maximum level. More...
#include <AsyncAudioClipper.h>
Public Member Functions | |
AudioClipper (float clip_level=1.0) | |
Default constuctor. | |
~AudioClipper (void) | |
Destructor. | |
void | setClipLevel (float level) |
Set the clip level. | |
![]() | |
AudioProcessor (void) | |
Default constuctor. | |
virtual | ~AudioProcessor (void) |
Destructor. | |
int | writeSamples (const float *samples, int len) |
Write audio to the filter. | |
void | flushSamples (void) |
Order a flush of all samples. | |
void | resumeOutput (void) |
Resume output to the sink if previously stopped. | |
void | allSamplesFlushed (void) |
All samples have been flushed by the sink. | |
![]() | |
AudioSink (void) | |
Default constuctor. | |
virtual | ~AudioSink (void) |
Destructor. | |
bool | registerSource (AudioSource *source) |
Register an audio source to provide samples to this sink. | |
void | unregisterSource (void) |
Unregister the previously registered audio source. | |
bool | isRegistered (void) const |
Check if an audio source has been registered. | |
AudioSource * | source (void) const |
Get the registered audio source. | |
![]() | |
AudioSource (void) | |
Default constuctor. | |
virtual | ~AudioSource (void) |
Destructor. | |
bool | registerSink (AudioSink *sink, bool managed=false) |
Register an audio sink to provide samples to. | |
void | unregisterSink (void) |
Unregister the previously registered audio sink. | |
bool | isRegistered (void) const |
Check if an audio sink has been registered. | |
AudioSink * | sink (void) const |
Get the registered audio sink. | |
bool | sinkManaged (void) const |
Check if the sink is managed or not. | |
void | handleAllSamplesFlushed (void) |
The registered sink has flushed all samples. | |
Protected Member Functions | |
virtual void | processSamples (float *dest, const float *src, int count) |
Process incoming samples and put them into the output buffer. | |
![]() | |
void | setInputOutputSampleRate (int input_rate, int output_rate) |
Set the input and output sample rates. | |
![]() | |
void | sourceResumeOutput (void) |
Tell the source that we are ready to accept more samples. | |
void | sourceAllSamplesFlushed (void) |
Tell the source that all samples have been flushed. | |
bool | setHandler (AudioSink *handler) |
Setup another sink to handle the incoming audio. | |
void | clearHandler (void) |
Clear a handler that was previously setup with setHandler. | |
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. | |
AudioSource * | handler (void) const |
void | clearHandler (void) |
Clear a handler that was previously setup with setHandler. | |
An audio pipe class to clip audio to a given maximum level.
This is an audio pipe class that is used to clip an audio stream to a given maximum level.
Definition at line 113 of file AsyncAudioClipper.h.
|
inlineexplicit |
Default constuctor.
clip_level | The level to clip at (1.0 is default) |
Definition at line 120 of file AsyncAudioClipper.h.
|
inline |
Destructor.
Definition at line 125 of file AsyncAudioClipper.h.
|
inlineprotectedvirtual |
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 should be reimplemented by the inheriting 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.
Definition at line 135 of file AsyncAudioClipper.h.
|
inline |
Set the clip level.
level | The level to set |
Definition at line 131 of file AsyncAudioClipper.h.