Function dsp::signal::from_interleaved_samples
[−]
[src]
pub fn from_interleaved_samples<I, F>(samples: I) -> FromInterleavedSamples<I, F> where F: Frame<Sample=I::Item>, I: Iterator, I::Item: Sample
An iterator that converts the given Iterator
yielding Sample
s to a Signal
yielding frames
of type F
.
Example
extern crate sample; use sample::signal; fn main() { let foo = [0, 1, 2, 3]; let mut signal = signal::from_interleaved_samples::<_, [i32; 2]>(foo.iter().cloned()); assert_eq!(signal.next(), Some([0, 1])); assert_eq!(signal.next(), Some([2, 3])); assert_eq!(signal.next(), None); let bar = [0, 1, 2]; let mut signal = signal::from_interleaved_samples::<_, [i32; 2]>(bar.iter().cloned()); assert_eq!(signal.next(), Some([0, 1])); assert_eq!(signal.next(), None); }