pub struct DynamicLoudness { /* private fields */ }Expand description
Dynamic Loudness Compensation processor
Implements ISO 226 inspired loudness compensation using a 7-band dynamic EQ. At low volumes, boosts low and high frequencies to compensate for the ear’s reduced sensitivity (Fletcher-Munson effect).
Implementations§
Source§impl DynamicLoudness
impl DynamicLoudness
Sourcepub fn set_volume(&mut self, linear_volume: f64)
pub fn set_volume(&mut self, linear_volume: f64)
Set user volume as linear value (0.0 - 1.0) This is the main control input
Sourcepub fn set_volume_percent(&mut self, percent: f64)
pub fn set_volume_percent(&mut self, percent: f64)
Set user volume as percentage (0 - 100)
Sourcepub fn set_volume_db(&mut self, volume_db: f64)
pub fn set_volume_db(&mut self, volume_db: f64)
Set user volume as dB
Sourcepub fn set_strength(&mut self, strength: f64)
pub fn set_strength(&mut self, strength: f64)
Set strength (0.0 - 1.0, scales all compensation)
Sourcepub fn set_reference_volume_db(&mut self, ref_db: f64)
pub fn set_reference_volume_db(&mut self, ref_db: f64)
Set reference volume level in dB
Sourcepub fn set_transition_db(&mut self, transition_db: f64)
pub fn set_transition_db(&mut self, transition_db: f64)
Set transition range in dB
Sourcepub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Enable or disable processing
Sourcepub fn set_sample_rate(&mut self, sample_rate: f64)
pub fn set_sample_rate(&mut self, sample_rate: f64)
Update sample rate
Sourcepub fn process(&mut self, buffer: &mut [f64])
pub fn process(&mut self, buffer: &mut [f64])
Process interleaved audio buffer
Coefficient ramps now track the per-block smoother within the buffer:
each BLOCK_SIZE-frame chunk advances the smoothers, applies any changed
band gain, then filters only that chunk’s frames. This avoids the
end-of-buffer “zipper” that occurred when the whole buffer was filtered
with only the final block’s coefficients. Total smoother advancement is
unchanged (Σ chunk_frames == frames), so end-of-buffer state matches the
previous behavior; buffers ≤ BLOCK_SIZE are filtered as a single block.
Sourcepub fn loudness_factor(&self) -> f64
pub fn loudness_factor(&self) -> f64
Get current loudness factor (for display)
Sourcepub fn get_band_gains(&self) -> [f64; 7]
pub fn get_band_gains(&self) -> [f64; 7]
Get current band gains (for display/metering)
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if enabled
Auto Trait Implementations§
impl Freeze for DynamicLoudness
impl RefUnwindSafe for DynamicLoudness
impl Send for DynamicLoudness
impl Sync for DynamicLoudness
impl Unpin for DynamicLoudness
impl UnsafeUnpin for DynamicLoudness
impl UnwindSafe for DynamicLoudness
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more