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)
pub fn mix(
&mut self,
computed_number_of_channels: usize,
interpretation: ChannelInterpretation
)
pub fn mix(
&mut self,
computed_number_of_channels: usize,
interpretation: ChannelInterpretation
)
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 AudioBuffer
s
If the channel counts differ, the buffer with lower count will be upmixed.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for AudioBuffer
impl !Send for AudioBuffer
impl !Sync for AudioBuffer
impl Unpin for AudioBuffer
impl !UnwindSafe for AudioBuffer
Blanket Implementations
Mutably borrows from an owned value. Read more