Function dsp::slice::to_sample_slice [] [src]

pub fn to_sample_slice<'a, T, S>(slice: T) -> &'a [S] where S: Sample, T: ToSampleSlice<'a, S>

Converts the given slice into a slice of Samples.

This is a convenience function that wraps the ToSampleSlice trait.

Examples

extern crate sample;

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