Function dsp::slice::to_sample_slice_mut [] [src]

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

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

This is a convenience function that wraps the ToSampleSliceMut trait.

Examples

extern crate sample;

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