pub struct RunningRMSProcessor { /* private fields */ }
Expand description
An AudioProcessor
which slides a window & calculates a running Squared sum of the input.
It exposes a RunningRMSProcessorHandle
which may be called from any thread to get the current
RMS in real-time.
When the internal window’s buffer needs to be resized, it’s replaced via an atomic pointer swap.
Implementations
sourceimpl RunningRMSProcessor
impl RunningRMSProcessor
sourcepub fn new_with_duration(gc_handle: &Handle, duration: Duration) -> Self
pub fn new_with_duration(gc_handle: &Handle, duration: Duration) -> Self
Create a RunningRMSProcessor
which will calculate RMS based on a certain duration
of
samples.
pub fn handle(&self) -> &Shared<RunningRMSProcessorHandle>
Trait Implementations
sourceimpl SimpleAudioProcessor for RunningRMSProcessor
impl SimpleAudioProcessor for RunningRMSProcessor
type SampleType = f32
sourcefn s_prepare(&mut self, settings: AudioProcessorSettings)
fn s_prepare(&mut self, settings: AudioProcessorSettings)
Prepare for playback based on current audio settings
sourcefn s_process_frame(&mut self, frame: &mut [Self::SampleType])
fn s_process_frame(&mut self, frame: &mut [Self::SampleType])
Process a multi-channel frame. Read more
sourcefn s_process(&mut self, sample: Self::SampleType) -> Self::SampleType
fn s_process(&mut self, sample: Self::SampleType) -> Self::SampleType
Process a single sample. If the input is mult-channel, will run for each channel by default.
If the processor is multi-channel, implement s_process_frame instead. Read more
Auto Trait Implementations
impl RefUnwindSafe for RunningRMSProcessor
impl Send for RunningRMSProcessor
impl Sync for RunningRMSProcessor
impl Unpin for RunningRMSProcessor
impl UnwindSafe for RunningRMSProcessor
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more