pub struct Normalizer { /* private fields */ }Expand description
Audio normalizer that adjusts amplitude to a target dBFS level.
Uses RMS (root mean square) measurement with smoothing to avoid sudden gain changes. Includes peak limiting to prevent clipping.
Implementations§
Source§impl Normalizer
impl Normalizer
Sourcepub fn with_settings(target_dbfs: f32, smoothing: f64, peak_limit: bool) -> Self
pub fn with_settings(target_dbfs: f32, smoothing: f64, peak_limit: bool) -> Self
Create a normalizer with custom settings.
Sourcepub fn rms_to_dbfs(rms: f64) -> f64
pub fn rms_to_dbfs(rms: f64) -> f64
Convert RMS to dBFS.
Sourcepub fn process(&mut self, samples: &[i16]) -> Vec<i16>
pub fn process(&mut self, samples: &[i16]) -> Vec<i16>
Process audio samples with normalization.
Returns a new buffer with normalized amplitude.
Sourcepub fn current_gain(&self) -> f64
pub fn current_gain(&self) -> f64
Get the current gain being applied.
Trait Implementations§
Source§impl Clone for Normalizer
impl Clone for Normalizer
Source§fn clone(&self) -> Normalizer
fn clone(&self) -> Normalizer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Normalizer
impl RefUnwindSafe for Normalizer
impl Send for Normalizer
impl Sync for Normalizer
impl Unpin for Normalizer
impl UnsafeUnpin for Normalizer
impl UnwindSafe for Normalizer
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
Mutably borrows from an owned value. Read more