Struct compressor::Compressor
[−]
[src]
pub struct Compressor<F, D, EGF> { pub threshold: f32, // some fields omitted }
A dynamics processing unit designed to compress some given audio signal that exceeds the
threshold
using the ratio
.
The Compressor is generic over its envelope Detector and the EvenGainFunction (used to determine the gain that will be applied evenly to all channels for a single frame).
Fields
threshold: f32
When the detected envelope exceeds this threshold, the signal is compressed via the ratio
.
Methods
impl<F, D, EGF> Compressor<F, D, EGF> where
F: Frame,
D: Detector<F>,
EGF: EvenGainFunction,
[src]
F: Frame,
D: Detector<F>,
EGF: EvenGainFunction,
fn compress_slice(&mut self, frames: &mut [F])
Compresses the given output
using an even gain across all channels.
impl<F, D, EGF> Compressor<F, D, EGF> where
F: Frame,
D: Detector<F>,
EGF: EvenGainFunction,
[src]
F: Frame,
D: Detector<F>,
EGF: EvenGainFunction,
fn set_attack_ms<M: Into<Ms>>(&mut self, ms: M, sample_hz: f64)
Set the duration of the envelope's attack in milliseconds.
fn set_release_ms<M: Into<Ms>>(&mut self, ms: M, sample_hz: f64)
Set the duration of the envelope's release in milliseconds.
fn update_attack_to_sample_hz(&mut self, sample_hz: f64)
Updates the Compressor's attack
gain in accordance with the current sample_hz.
fn update_release_to_sample_hz(&mut self, sample_hz: f64)
Updates the Compressor's release
gain in accordance with the current sample_hz.
fn next_gain_per_channel(&mut self, next_frame: F) -> F::Float
Steps forward the detectors using the given frame and determines the gain per-channel,
yielding the result as a Frame
.
fn next_gain(&mut self, next_frame: F) -> <F::Sample as Sample>::Float
Produce the gain to be applied evenly across all channels for the next frame.
fn next_frame(&mut self, next_frame: F) -> F
Steps forward the Compressor
by the given frame and returns the compressed result.
Trait Implementations
impl<F: Clone, D: Clone, EGF: Clone> Clone for Compressor<F, D, EGF>
[src]
fn clone(&self) -> Compressor<F, D, EGF>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more