Function to_sample_slice_mut

Source
pub fn to_sample_slice_mut<'a, T, S>(slice: T) -> &'a mut [S]
where S: Sample, T: ToSampleSliceMut<'a, S>,
Expand description

Converts the given mutable slice of Frames into a mutable slice of Samples.

This is a convenience function that wraps the ToSampleSliceMut trait.

ยงExamples

fn main() {
    let foo = &mut [[0.0, 0.5], [0.0, -0.5]][..];
    let bar = dasp_slice::to_sample_slice_mut(foo);
    assert_eq!(bar, &mut [0.0, 0.5, 0.0, -0.5][..]);
}