pub struct Normalizer<'a> { /* private fields */ }Available on crate feature
normalize only.Expand description
One-shot normaliser: analyse + scale a buffer in place.
Implementations§
Source§impl<'a> Normalizer<'a>
impl<'a> Normalizer<'a>
Sourcepub fn new(sample_rate: u32, channels: &'a [Channel]) -> Self
pub fn new(sample_rate: u32, channels: &'a [Channel]) -> Self
Build a fresh normaliser. Default target is −23 LUFS (EBU R128 broadcast reference).
Sourcepub fn target_lufs(self, lufs: f64) -> Self
pub fn target_lufs(self, lufs: f64) -> Self
Set the target integrated loudness in LUFS.
Sourcepub fn true_peak_ceiling_dbtp(self, dbtp: f64) -> Self
pub fn true_peak_ceiling_dbtp(self, dbtp: f64) -> Self
Cap the post-normalisation true peak at this dBTP value. If the
gain required to reach target_lufs would push the true peak
above the ceiling, the gain is reduced.
Sourcepub fn normalize_in_place(
&self,
samples: &mut [f32],
) -> Result<NormalizeReport, Error>
pub fn normalize_in_place( &self, samples: &mut [f32], ) -> Result<NormalizeReport, Error>
Run the analyser, compute the gain, and scale samples in place.
samples is interleaved ([L0 R0 L1 R1 ...]).
Returns the NormalizeReport describing what happened.
§Errors
Anything AnalyzerBuilder::build or
crate::Analyzer::push_interleaved can return.
Trait Implementations§
Source§impl<'a> Clone for Normalizer<'a>
impl<'a> Clone for Normalizer<'a>
Source§fn clone(&self) -> Normalizer<'a>
fn clone(&self) -> Normalizer<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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<'a> Freeze for Normalizer<'a>
impl<'a> RefUnwindSafe for Normalizer<'a>
impl<'a> Send for Normalizer<'a>
impl<'a> Sync for Normalizer<'a>
impl<'a> Unpin for Normalizer<'a>
impl<'a> UnsafeUnpin for Normalizer<'a>
impl<'a> UnwindSafe for Normalizer<'a>
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