[][src]Function dasp_slice::boxed::to_boxed_sample_slice

pub fn to_boxed_sample_slice<T, S>(slice: T) -> Box<[S]> where
    S: Sample,
    T: ToBoxedSampleSlice<S>, 

Converts the given boxed slice into a boxed slice of Samples.

This is a convenience function that wraps the ToBoxedSampleSlice trait.

Examples

fn main() {
    let foo = vec![[0.0, 0.5], [0.0, -0.5]].into_boxed_slice();
    let bar = dasp_slice::to_boxed_sample_slice(foo);
    assert_eq!(bar.into_vec(), vec![0.0, 0.5, 0.0, -0.5]);
}

Required Features

  • When using dasp_slice, this item requires the boxed feature to be enabled.
  • When using dasp, this item requires the slice-boxed feature to be enabled.