Struct web_audio_api::render::AudioRenderQuantum [−][src]
pub struct AudioRenderQuantum { /* fields omitted */ }
Expand description
Internal fixed length audio asset of RENDER_QUANTUM_SIZE
sample frames for
block rendering, basically a matrix of channels * [f32; RENDER_QUANTUM_SIZE]
cf. https://webaudio.github.io/web-audio-api/#render-quantum
An AudioRenderQuantum
has copy-on-write semantics, so it is cheap to clone.
Implementations
Number of channels in this AudioRenderQuantum
Set number of channels in this AudioRenderQuantum
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 AudioRenderQuantum
s
If the channel counts differ, the buffer with lower count will be upmixed.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for AudioRenderQuantum
impl !Send for AudioRenderQuantum
impl !Sync for AudioRenderQuantum
impl Unpin for AudioRenderQuantum
impl !UnwindSafe for AudioRenderQuantum
Blanket Implementations
Mutably borrows from an owned value. Read more