pub struct ChannelMatrix { /* private fields */ }Expand description
Finite row-major channel mapping applied before sample quantization.
Implementations§
Source§impl ChannelMatrix
impl ChannelMatrix
Sourcepub fn new(
input_channels: usize,
output_channels: usize,
gains: Vec<f32>,
) -> Result<Self, PcmConversionError>
pub fn new( input_channels: usize, output_channels: usize, gains: Vec<f32>, ) -> Result<Self, PcmConversionError>
Builds a bounded row-major matrix with one row per output channel.
Sourcepub fn identity(channels: usize) -> Result<Self, PcmConversionError>
pub fn identity(channels: usize) -> Result<Self, PcmConversionError>
Builds an identity mapping for channels interleaved lanes.
Sourcepub fn mono_to_stereo() -> Self
pub fn mono_to_stereo() -> Self
Builds the canonical mono-to-stereo duplication mapping.
Sourcepub fn stereo_to_mono() -> Self
pub fn stereo_to_mono() -> Self
Builds an equal-amplitude stereo-to-mono downmix.
Each input is scaled by one half, so equal correlated channels retain their level without clipping solely because of the mapping.
Sourcepub fn input_channels(&self) -> usize
pub fn input_channels(&self) -> usize
Returns the number of interleaved source channels.
Sourcepub fn output_channels(&self) -> usize
pub fn output_channels(&self) -> usize
Returns the number of interleaved destination channels.
Trait Implementations§
Source§impl Clone for ChannelMatrix
impl Clone for ChannelMatrix
Source§fn clone(&self) -> ChannelMatrix
fn clone(&self) -> ChannelMatrix
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChannelMatrix
impl Debug for ChannelMatrix
Source§impl PartialEq for ChannelMatrix
impl PartialEq for ChannelMatrix
impl StructuralPartialEq for ChannelMatrix
Auto Trait Implementations§
impl Freeze for ChannelMatrix
impl RefUnwindSafe for ChannelMatrix
impl Send for ChannelMatrix
impl Sync for ChannelMatrix
impl Unpin for ChannelMatrix
impl UnsafeUnpin for ChannelMatrix
impl UnwindSafe for ChannelMatrix
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