Function dsp::signal::gen [] [src]

pub fn gen<G, F>(gen: G) -> Gen<G, F> where F: Frame, G: Fn() -> F

A signal that generates frames using the given function.

Example

extern crate sample;

fn main() {
    let mut frames = sample::signal::gen(|| [0.5]);
    assert_eq!(frames.next(), Some([0.5]));
    assert_eq!(frames.next(), Some([0.5]));
}