pub struct Oscillator<T> { /* private fields */ }
Implementations
sourceimpl Oscillator<f32>
impl Oscillator<f32>
sourcepub fn sine(sample_rate: f32) -> Oscillator<f32>
pub fn sine(sample_rate: f32) -> Oscillator<f32>
Construct a sine generator
sourceimpl<T> Oscillator<T>
impl<T> Oscillator<T>
sourcepub fn new_with_sample_rate(
sample_rate: f32,
generator_fn: fn(T) -> T
) -> Oscillator<T>
pub fn new_with_sample_rate(
sample_rate: f32,
generator_fn: fn(T) -> T
) -> Oscillator<T>
Construct a new oscillator with a given sample rate
sourcepub fn new(generator_fn: fn(T) -> T) -> Oscillator<T>
pub fn new(generator_fn: fn(T) -> T) -> Oscillator<T>
Construct an oscillator with 44.1Hz default sample rate
sourceimpl<T> Oscillator<T>
impl<T> Oscillator<T>
sourcepub fn set_sample_rate(&mut self, sample_rate: f32)
pub fn set_sample_rate(&mut self, sample_rate: f32)
Set the sample rate
sourceimpl<T> Oscillator<T>
impl<T> Oscillator<T>
sourcepub fn get_frequency(&self) -> f32
pub fn get_frequency(&self) -> f32
Get the oscillator frequency
sourcepub fn set_frequency(&mut self, frequency: f32)
pub fn set_frequency(&mut self, frequency: f32)
Set the oscillator frequency
sourceimpl<T> Oscillator<T> where
T: From<f32>,
impl<T> Oscillator<T> where
T: From<f32>,
Trait Implementations
sourceimpl<T> Clone for Oscillator<T> where
T: Clone,
impl<T> Clone for Oscillator<T> where
T: Clone,
sourcefn clone(&self) -> Oscillator<T>
fn clone(&self) -> Oscillator<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for Oscillator<T>
impl<T> Send for Oscillator<T>
impl<T> Sync for Oscillator<T>
impl<T> Unpin for Oscillator<T>
impl<T> UnwindSafe for Oscillator<T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more