Struct web_audio_api::buffer::AudioBuffer[][src]

pub struct AudioBuffer { /* fields omitted */ }
Expand description

Memory-resident audio asset, basically a matrix of channels * samples

An AudioBuffer has copy-on-write semantics, so it is cheap to clone.

Implementations

Allocate a silent audiobuffer with AudioBufferOptions

Convert raw samples to an AudioBuffer

The outer Vec determine the channels. The inner Vecs should have the same length.

Panics

This function will panic if samples is an empty Vec or if any of its elements have different lengths.

Number of channels in this AudioBuffer

Number of samples per channel in this AudioBuffer

Sample rate of this AudioBuffer in Hertz

Duration in seconds of the AudioBuffer

Copy data from a given channel to the given Vec

Copy data from a given channel to the given Vec starting at offset

Copy data from a given source to the given channel.

Copy data from a given source to the given channel starting at offset.

Return a read-only copy of the underlying data of the channel

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. 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

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

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.