logo

Struct fon::Audio

source · []
pub struct Audio<Chan: Channel, const CH: usize> { /* private fields */ }
Expand description

Audio buffer (fixed-size array of audio Frames at sample rate specified in hertz).

Implementations

Construct an Audio buffer with all all samples set to zero.

Construct an Audio buffer with owned sample data. You can get ownership of the sample data back from the Audio buffer as either a Vec<S> or a Box<[S]> by calling into().

Construct an Audio buffer from another Audio buffer of a different format.

Get an audio frame.

Get a mutable reference to an audio frame.

Get a slice of all audio frames.

Get a slice of all audio frames.

Returns an iterator over the audio frames.

Returns an iterator that allows modifying each audio frame.

Get the sample rate of this audio buffer.

Get the length of the Audio buffer.

Check if Audio buffer is empty.

Silence the audio buffer.

Sink audio into this audio buffer from a Stream.

Construct an Audio buffer from an i16 buffer.

Get view of samples as an i16 slice.

Construct an Audio buffer from an u8 buffer.

Get view of samples as an u8 slice.

Construct an Audio buffer from an f32 buffer.

Get view of samples as an f32 slice.

Construct an Audio buffer from an f64 buffer.

Get view of samples as an f64 slice.

Trait Implementations

Formats the value using the given formatter. Read more

Get internal sample data as boxed slice of i16.

Get internal sample data as boxed slice of u8.

Get internal sample data as boxed slice of f32.

Get internal sample data as boxed slice of f64.

Get internal sample data as Vec of audio frames.

Get internal sample data as Vec of audio frames.

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

Performs the conversion.

Performs the conversion.

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.