pub struct SineWave {
    pub sample_rate: u32,
    pub freq: f32,
    /* private fields */
}
Expand description

A SoundSource that generates a sine wave with a given frequency.

Fields

sample_rate: u32

The sample_rate of this SoundSource.

freq: f32

The frequency of the sine wave, in Hertz

Implementations

Create a new SineWave SoundSource.

Created one the given sample_rate and frequency, both in Hertz.

Trait Implementations

Return the sample rate.

Return the number of channels.

Start the sound from the begining.

Write the samples to buffer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.