Struct kira::track::effect::compressor::CompressorBuilder
source · #[non_exhaustive]pub struct CompressorBuilder {
pub threshold: Value<f64>,
pub ratio: Value<f64>,
pub attack_duration: Value<Duration>,
pub release_duration: Value<Duration>,
pub makeup_gain: Value<f64>,
pub mix: Value<f64>,
}
Expand description
Configures a compressor.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.threshold: Value<f64>
The volume above which volume will start to be decreased (in dBFS).
ratio: Value<f64>
How much the signal will be compressed.
A ratio of 2.0
(or 2 to 1) means an increase of 3dB will
become an increase of 1.5dB. Ratios between 0.0
and 1.0
will actually expand the audio.
attack_duration: Value<Duration>
How much time it takes for the volume attenuation to ramp up once the input volume exceeds the threshold.
release_duration: Value<Duration>
How much time it takes for the volume attenuation to relax once the input volume dips below the threshold.
makeup_gain: Value<f64>
The amount to change the volume after processing (in dB).
This can be used to compensate for the decrease in volume resulting from compression. This is only applied to the wet signal, nto the dry signal.
mix: Value<f64>
How much dry (unprocessed) signal should be blended
with the wet (processed) signal. 0.0
means
only the dry signal will be heard. 1.0
means
only the wet signal will be heard.
Implementations§
source§impl CompressorBuilder
impl CompressorBuilder
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new CompressorBuilder
with the default settings.
sourcepub fn threshold(self, threshold: impl Into<Value<f64>>) -> Self
pub fn threshold(self, threshold: impl Into<Value<f64>>) -> Self
Sets the volume above which volume will start to be decreased (in dBFS).
sourcepub fn ratio(self, ratio: impl Into<Value<f64>>) -> Self
pub fn ratio(self, ratio: impl Into<Value<f64>>) -> Self
Sets how much the signal will be compressed.
A ratio of 2.0
(or 2 to 1) means an increase of 3dB will
become an increase of 1.5dB. Ratios between 0.0
and 1.0
will actually expand the audio.
sourcepub fn attack_duration(
self,
attack_duration: impl Into<Value<Duration>>
) -> Self
pub fn attack_duration( self, attack_duration: impl Into<Value<Duration>> ) -> Self
Sets how much time it takes for the volume attenuation to ramp up once the input volume exceeds the threshold.
sourcepub fn release_duration(
self,
release_duration: impl Into<Value<Duration>>
) -> Self
pub fn release_duration( self, release_duration: impl Into<Value<Duration>> ) -> Self
Sets how much time it takes for the volume attenuation to relax once the input volume dips below the threshold.
sourcepub fn makeup_gain(self, makeup_gain: impl Into<Value<f64>>) -> Self
pub fn makeup_gain(self, makeup_gain: impl Into<Value<f64>>) -> Self
Sets the amount to change the volume after processing (in dB).
This can be used to compensate for the decrease in volume resulting from compression. This is only applied to the wet signal, nto the dry signal.