pub struct StatefulMixer { /* private fields */ }Expand description
Persistent allocation-free mixing of aligned mono tracks into stereo.
Call reset after a discontinuous seek, track-slot reassignment or sample-rate
change. Source scheduling, resampling, limiting and device playback remain
host duties. Effect memory follows the input while bypassed: lowpass tracks
the last source sample, while EQ and compressor retain their normal smoothers.
Delay stores processed input even when bypassed; changes to its length read
from that history, with no crossfade. This delay has no feedback or tail policy.
Implementations§
Source§impl StatefulMixer
impl StatefulMixer
pub fn new() -> Self
Sourcepub fn process_block(
&mut self,
plan: &ProcessPlan,
inputs: &[&[f32]],
frames: usize,
out: &mut [f32],
) -> Result<(), &'static str>
pub fn process_block( &mut self, plan: &ProcessPlan, inputs: &[&[f32]], frames: usize, out: &mut [f32], ) -> Result<(), &'static str>
Mix aligned blocks, with silence supplied for inactive tracks. Block length may vary up to the plan’s block size. Muted tracks continue to advance their effect memory. Validation precedes all state/output writes. Samples and gain are bounded to ±16, EQ to ±60 dB, compressor threshold to 0..=1, ratio to 1..=100, and pan, lowpass and delay mix to their usual normalized ranges. EQ frequency is accepted when finite and nonnegative: the current EQ helper is a shelf and does not use that frequency. These conservative limits keep the signal chain finite; no limiting occurs.