Struct oxcable_basic_devices::dynamics::compressor::Compressor
[−]
[src]
pub struct Compressor { // some fields omitted }
A compression filter.
Compression filters provide a soft limit on the maximum amplitude of a signal. When a signal exceeds the threshold of the filter, it is partially attenuated to bring it closer to the threshold.
The intensity of the attenuation is determined by the compression ratio. A ratio of zero provides no attenuation. A ratio of 1 will hard limit the signal to the threshold. Values in between will provide partial attenuation.
Methods
impl Compressor
fn new(threshold: f32, compression_ratio: f32, gain: f32, num_channels: usize) -> Self
Creates a new compressor.
- The
threshold
specifies the decibel level at which compression begins. - The
compression_ratio
specifies the ratio of attenuation above the threshold. - The
gain
(in decibels) will be applied to the signal after compression.