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§
Sourcefn mix_to_mono(&self, dest: &mut MonoViewMut<'_, S>) -> Option<usize>
fn mix_to_mono(&self, dest: &mut MonoViewMut<'_, S>) -> Option<usize>
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.
Sourcefn mix_to_mono_exact(&self, dest: &mut MonoViewMut<'_, S>)
fn mix_to_mono_exact(&self, dest: &mut MonoViewMut<'_, S>)
Mix all channels to mono by averaging them. Panics if source and destination don’t have the same number of frames.
Sourcefn copy_channel_to_mono(
&self,
dest: &mut MonoViewMut<'_, S>,
channel: u16,
) -> Option<usize>
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.
Sourcefn copy_channel_to_mono_exact(
&self,
dest: &mut MonoViewMut<'_, S>,
channel: u16,
)
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.