pub struct StereoMultiMixer<T: Float> { /* private fields */ }Expand description
Upmix/downmix a stereo signal to an (even) multi-channel signal
When spreading out, it rotates the input by various amounts (e.g. a four-channel signal
would produce (left, right, mid, side)), such that energy is preserved for each pair.
When mixing together, it uses the opposite rotations, such that upmix → downmix
produces the same stereo signal (when scaled by .scaling_factor1()).
Implementations§
Source§impl<T: Float + FromPrimitive> StereoMultiMixer<T>
impl<T: Float + FromPrimitive> StereoMultiMixer<T>
Sourcepub fn new(channels: usize) -> Self
pub fn new(channels: usize) -> Self
Create a new mixer with the specified number of channels (must be even)
Sourcepub fn stereo_to_multi(&self, input: &[T; 2], output: &mut [T])
pub fn stereo_to_multi(&self, input: &[T; 2], output: &mut [T])
Convert a stereo signal to a multi-channel signal
Sourcepub fn multi_to_stereo(&self, input: &[T], output: &mut [T; 2])
pub fn multi_to_stereo(&self, input: &[T], output: &mut [T; 2])
Convert a multi-channel signal back to stereo
Sourcepub fn scaling_factor1(&self) -> T
pub fn scaling_factor1(&self) -> T
Scaling factor for the downmix, if channels are phase-aligned
Sourcepub fn scaling_factor2(&self) -> T
pub fn scaling_factor2(&self) -> T
Scaling factor for the downmix, if channels are independent
Auto Trait Implementations§
impl<T> Freeze for StereoMultiMixer<T>
impl<T> RefUnwindSafe for StereoMultiMixer<T>where
T: RefUnwindSafe,
impl<T> Send for StereoMultiMixer<T>where
T: Send,
impl<T> Sync for StereoMultiMixer<T>where
T: Sync,
impl<T> Unpin for StereoMultiMixer<T>where
T: Unpin,
impl<T> UnwindSafe for StereoMultiMixer<T>where
T: UnwindSafe,
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