Function dsp::slice::from_boxed_frame_slice [] [src]

pub fn from_boxed_frame_slice<T, F>(slice: Box<[F]>) -> T where F: Frame, T: FromBoxedFrameSlice<F>

Converts the given boxed slice of Frames into some slice T.

This is a convenience function that wraps the FromBoxedFrameSlice trait.

Examples

extern crate sample;

fn main() {
    let foo = vec![[0.0, 0.5], [0.0, -0.5]].into_boxed_slice();
    let bar: Box<[f32]> = sample::slice::from_boxed_frame_slice(foo);
    assert_eq!(bar.into_vec(), vec![0.0, 0.5, 0.0, -0.5]);
}