pub struct VolumeLimiter { /* private fields */ }
Expand description
A multi-channel audio limiter.
Can be useful to prevent clipping on loud audio.
Implementations§
Source§impl VolumeLimiter
impl VolumeLimiter
Sourcepub fn new(channel_count: u16) -> VolumeLimiter
pub fn new(channel_count: u16) -> VolumeLimiter
Initializes a new audio limiter with a specified audio channel count.
Sourcepub fn limit(&mut self, sample: &mut [f32])
pub fn limit(&mut self, sample: &mut [f32])
Applies the limiting algorithm to the given sample buffer to prevent clipping.
pub fn limit_iter<'a, 'b, T: 'b + Iterator<Item = f32>>( &'a mut self, samples: T, ) -> VolumeLimiterIter<'a, 'b, T> ⓘ
Auto Trait Implementations§
impl Freeze for VolumeLimiter
impl RefUnwindSafe for VolumeLimiter
impl Send for VolumeLimiter
impl Sync for VolumeLimiter
impl Unpin for VolumeLimiter
impl UnwindSafe for VolumeLimiter
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
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>
Converts
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>
Converts
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