Async::AudioCompressor Class Reference

A class to do audio compression/limiting. More...

#include <AsyncAudioCompressor.h>

Inheritance diagram for Async::AudioCompressor:
Async::AudioProcessor Async::AudioSink Async::AudioSource

List of all members.

Public Member Functions

Protected Member Functions


Detailed Description

A class to do audio compression/limiting.

Author:
Tobias Blomberg / SM0SVX
Date:
2006-05-01

Use this audio pipe class to do compression on an audio stream. Compression is a method to reduce the dynamic range of an audio signal. After it has been compressed it can be amplified to get a more audible end result.

This audio pipe component is mostly untested and is based on some ripped off code which I really have not checked how it performs or if it works at all...

Definition at line 169 of file AsyncAudioCompressor.h.


Constructor & Destructor Documentation

Async::AudioCompressor::AudioCompressor ( void   ) 

Default constuctor.

Async::AudioCompressor::~AudioCompressor ( void   ) 

Destructor.


Member Function Documentation

virtual void Async::AudioCompressor::processSamples ( float *  dest,
const float *  src,
int  count 
) [protected, virtual]

Process incoming samples and put them into the output buffer.

Parameters:
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.

void Async::AudioCompressor::reset ( void   ) 

Reset the compressor.

void Async::AudioCompressor::setAttack ( double  attack_ms  )  [inline]

Set the compressor attack time.

Parameters:
attack_ms The attack time in milliseconds

Definition at line 201 of file AsyncAudioCompressor.h.

References Async::EnvelopeDetector::setTc().

void Async::AudioCompressor::setDecay ( double  decay_ms  )  [inline]

Set the compressor decay time.

Parameters:
decay_ms The decay time in milliseconds

Definition at line 207 of file AsyncAudioCompressor.h.

References Async::EnvelopeDetector::setTc().

void Async::AudioCompressor::setOutputGain ( float  gain  ) 

Set the output gain.

Parameters:
gain The gain to set.

The output gain is the amplification applied to the audio signal before it leaves the compressor. If gain > 1 the signal is amplified. If gain < 1 the signal is attenuated.

void Async::AudioCompressor::setRatio ( double  ratio  )  [inline]

Set the compression ratio.

Parameters:
ratio The compression ratio (ex 0.1 == 10:1)

Definition at line 195 of file AsyncAudioCompressor.h.

void Async::AudioCompressor::setThreshold ( double  thresh_db  )  [inline]

Set the compression threshold.

Parameters:
thresh_db The compression threshold in dB

The threshold is the level, in dB, the signal must rise to before the compressor kicks in.

Definition at line 189 of file AsyncAudioCompressor.h.


The documentation for this class was generated from the following file:
Generated by  doxygen 1.6.2-20100208