Skip to main content

AudioBlockOps

Trait AudioBlockOps 

Source
pub trait AudioBlockOps<S: Sample> {
    // Required methods
    fn mix_to_mono(&self, dest: &mut MonoViewMut<'_, S>) -> Option<usize>
       where S: AddAssign + Div<Output = S> + From<u16>;
    fn mix_to_mono_exact(&self, dest: &mut MonoViewMut<'_, S>)
       where S: AddAssign + Div<Output = S> + From<u16>;
    fn copy_channel_to_mono(
        &self,
        dest: &mut MonoViewMut<'_, S>,
        channel: u16,
    ) -> Option<usize>;
    fn copy_channel_to_mono_exact(
        &self,
        dest: &mut MonoViewMut<'_, S>,
        channel: u16,
    );
}

Required Methods§

Source

fn mix_to_mono(&self, dest: &mut MonoViewMut<'_, S>) -> Option<usize>
where S: AddAssign + Div<Output = S> + From<u16>,

Mix all channels to mono by averaging them. Only processes min(src_frames, dst_frames) frames. Returns None if all frames were processed (exact match), or Some(frames_processed) if a partial mix occurred.

Source

fn mix_to_mono_exact(&self, dest: &mut MonoViewMut<'_, S>)
where S: AddAssign + Div<Output = S> + From<u16>,

Mix all channels to mono by averaging them. Panics if source and destination don’t have the same number of frames.

Source

fn copy_channel_to_mono( &self, dest: &mut MonoViewMut<'_, S>, channel: u16, ) -> Option<usize>

Copy a specific channel to a mono buffer. Only copies min(src_frames, dst_frames) frames. Returns None if all frames were copied (exact match), or Some(frames_copied) if a partial copy occurred.

Source

fn copy_channel_to_mono_exact( &self, dest: &mut MonoViewMut<'_, S>, channel: u16, )

Copy a specific channel to a mono buffer. Panics if source and destination don’t have the same number of frames.

Implementors§

Source§

impl<S: Sample, B: AudioBlock<S>> AudioBlockOps<S> for B