Struct web_audio_api::alloc::AudioBuffer[][src]

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

Fixed length audio asset, basically a matrix of channels * [f32; BUFFER_SIZE]

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

Implementations

Number of channels in this AudioBuffer

Set number of channels in this AudioBuffer

Note: if the new number is higher than the previous, the new channels will be filled with garbage.

Get the samples from this specific channel.

Panics if the index is greater than the available number of channels

Get the samples (mutable) from this specific channel.

Panics if the index is greater than the available number of channels

Channel data as slice

Channel data as slice (mutable)

Up/Down-mix to the desired number of channels

Convert this buffer to silence

Convert to a single channel buffer, dropping excess channels

Modify every channel in the same way

Sum two AudioBuffers

If the channel counts differ, the buffer with lower count will be upmixed.

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.