27#ifndef ASYNC_AUDIO_COMPRESSOR_INCLUDED
28#define ASYNC_AUDIO_COMPRESSOR_INCLUDED
110 : sampleRate_( sampleRate ), ms_( ms ), coef_( 0.0 )
124 virtual double getTc(
void ) {
return ms_; }
129 sampleRate_ = sampleRate;
136 inline void run(
double in,
double &state )
138 state = in + coef_ * ( state - in );
148 coef_ = exp( -1.0 / ( 0.001 * ms_ * sampleRate_ ) );
The base class for an audio processor class.
A class to do audio compression/limiting.
void setDecay(double decay_ms)
Set the compressor decay time.
void setRatio(double ratio)
Set the compression ratio.
~AudioCompressor(void)
Destructor.
void reset(void)
Reset the compressor.
void setAttack(double attack_ms)
Set the compressor attack time.
void setThreshold(double thresh_db)
Set the compression threshold.
AudioCompressor(void)
Default constuctor.
void setOutputGain(float gain)
Set the output gain.
virtual void processSamples(float *dest, const float *src, int count)
Process incoming samples and put them into the output buffer.
The base class for an audio processor.
virtual void setTc(double ms)
EnvelopeDetector(double ms=1.0, double sampleRate=INTERNAL_SAMPLE_RATE)
void run(double in, double &state)
virtual double getTc(void)
virtual void setSampleRate(double sampleRate)
virtual double getSampleRate(void)
virtual ~EnvelopeDetector()
Namespace for the asynchronous programming classes.