Struct web_audio_api::alloc::AudioBuffer [−][src]
pub struct AudioBuffer { /* fields omitted */ }
Memory-resident audio asset, basically a matrix of channels * samples
An AudioBuffer has copy-on-write semantics, so it is cheap to clone.
Implementations
impl AudioBuffer
[src]
pub fn new(channel: ChannelData) -> Self
[src]
pub fn number_of_channels(&self) -> usize
[src]
Number of channels in this AudioBuffer
pub fn set_number_of_channels(&mut self, n: usize)
[src]
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.
pub fn channel_data(&self, channel: usize) -> &ChannelData
[src]
Get the samples from this specific channel.
pub fn channel_data_mut(&mut self, channel: usize) -> &mut ChannelData
[src]
Get the samples from this specific channel (mutable).
pub fn mix(&mut self, channels: usize, interpretation: ChannelInterpretation)
[src]
Up/Down-mix to the desired number of channels
pub fn make_silent(&mut self)
[src]
Convert this buffer to silence
pub fn force_mono(&mut self)
[src]
Convert to a single channel buffer, dropping excess channels
pub fn modify_channels<F: Fn(&mut ChannelData)>(&mut self, fun: F)
[src]
Modify every channel in the same way
pub fn add(&mut self, other: &Self, interpretation: ChannelInterpretation)
[src]
Sum two AudioBuffers
If the channel counts differ, the buffer with lower count will be upmixed.
Trait Implementations
impl Clone for AudioBuffer
[src]
fn clone(&self) -> AudioBuffer
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,