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§
source§impl 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 from_handle(handle: Shared<RunningRMSProcessorHandle>) -> Self
pub fn handle(&self) -> &Shared<RunningRMSProcessorHandle>
Trait Implementations§
source§impl SimpleAudioProcessor for RunningRMSProcessor
impl SimpleAudioProcessor for RunningRMSProcessor
type SampleType = f32
source§fn s_prepare(
&mut self,
_context: &mut AudioContext,
settings: AudioProcessorSettings
)
fn s_prepare( &mut self, _context: &mut AudioContext, settings: AudioProcessorSettings )
Prepare for playback based on current audio settings
source§fn s_process_frame(
&mut self,
_context: &mut AudioContext,
frame: &mut [Self::SampleType]
)
fn s_process_frame( &mut self, _context: &mut AudioContext, frame: &mut [Self::SampleType] )
Process a multi-channel frame.