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_ ) );
226 virtual void processSamples(
float *dest,
const float *src,
int count);
virtual double getSampleRate(void)
virtual void processSamples(float *dest, const float *src, int count)
Process incoming samples and put them into the output buffer.
void setRatio(double ratio)
Set the compression ratio.
The base class for an audio processor.
void setOutputGain(float gain)
Set the output gain.
~AudioCompressor(void)
Destructor.
virtual ~EnvelopeDetector()
void reset(void)
Reset the compressor.
void setDecay(double decay_ms)
Set the compressor decay time.
void setAttack(double attack_ms)
Set the compressor attack time.
virtual void setTc(double ms)
virtual double getTc(void)
A class to do audio compression/limiting.
virtual void setSampleRate(double sampleRate)
Namespace for the asynchronous programming classes.
AudioCompressor(void)
Default constuctor.
The base class for an audio processor class.
void setThreshold(double thresh_db)
Set the compression threshold.
void run(double in, double &state)
EnvelopeDetector(double ms=1.0, double sampleRate=INTERNAL_SAMPLE_RATE)