Struct twang::Generator [−][src]
pub struct Generator(_, _, _);
An audio wave generator.
Methods
impl Generator
[src]
impl Generator
pub fn new(hz: f64, volume: f64) -> Self
[src]
pub fn new(hz: f64, volume: f64) -> Self
Create a new generator with default pitch[hz] and volume[0-1].
pub fn pitch(&mut self, hz: f64)
[src]
pub fn pitch(&mut self, hz: f64)
Set pitch. Takes in Hertz.
pub fn volume(&mut self, volume: f64)
[src]
pub fn volume(&mut self, volume: f64)
Set volume. Range 0 to 1
pub fn next(&mut self) -> f64
[src]
pub fn next(&mut self) -> f64
Get the next sample's time value.