pub struct AudioBuffer<T: FloatType> { /* private fields */ }Trait Implementations§
Source§impl<T: FloatType> AudioBufferImpl<T> for AudioBuffer<T>
impl<T: FloatType> AudioBufferImpl<T> for AudioBuffer<T>
Source§fn new(len: usize, layout: AudioChannelLayout) -> AudioBuffer<T>
fn new(len: usize, layout: AudioChannelLayout) -> AudioBuffer<T>
Creates a new planar audio buffer with the specified length (per channel) and channel layout.
Source§fn new_with_layout(layout: AudioChannelLayout) -> AudioBuffer<T>
fn new_with_layout(layout: AudioChannelLayout) -> AudioBuffer<T>
Creates a new planar audio buffer with default length (0) and the specified layout.
Source§fn get_channel(&self, channel: usize) -> &[T]
fn get_channel(&self, channel: usize) -> &[T]
Returns an immutable slice for the specified channel.
Panics if the channel index exceeds the layout’s channel count.
Source§fn get_channel_mut(&mut self, channel: usize) -> &mut [T]
fn get_channel_mut(&mut self, channel: usize) -> &mut [T]
Returns a mutable slice for the specified channel.
Panics if the channel index exceeds the layout’s channel count.
Source§unsafe fn get_channel_unchecked(&self, channel: usize) -> &[T]
unsafe fn get_channel_unchecked(&self, channel: usize) -> &[T]
Returns an immutable slice for the specified channel without bounds checking.
Source§unsafe fn get_channel_unchecked_mut(&mut self, channel: usize) -> &mut [T]
unsafe fn get_channel_unchecked_mut(&mut self, channel: usize) -> &mut [T]
Returns a mutable slice for the specified channel without bounds checking.
Source§fn resize(&mut self, new_len: usize)
fn resize(&mut self, new_len: usize)
Resizes all channel buffers to the new length, filling new space with zeros.
Source§fn copy_to_interleaved(&self, dst: &mut [T])
fn copy_to_interleaved(&self, dst: &mut [T])
Copies all channels’ data into an interleaved destination slice.
Panics if the destination length does not match
self.len() * self.channel_layout() as usize.Source§fn mix_with(&mut self, other: &AudioBuffer<T>)
fn mix_with(&mut self, other: &AudioBuffer<T>)
Mixes another AudioBuffer into this one without applying gain.
Panics if lengths or layouts do not match.
Source§fn mix_with_gain(&mut self, other: &AudioBuffer<T>, gain: f32)
fn mix_with_gain(&mut self, other: &AudioBuffer<T>, gain: f32)
Mixes another AudioBuffer into this one with the specified gain applied to the other buffer.
Panics if lengths or layouts do not match.
Source§fn copy_from(&mut self, other: &AudioBuffer<T>)
fn copy_from(&mut self, other: &AudioBuffer<T>)
Copies data from another AudioBuffer.
Panics if lengths or layouts do not match.
Source§fn copy_from_interleaved(&mut self, buffer: &[T])
fn copy_from_interleaved(&mut self, buffer: &[T])
Copies data from an interleaved buffer.
Panics if the interleaved length does not match the expected size.
Source§fn copy_from_interleaved_range(
&mut self,
input: &[T],
start: usize,
end: usize,
offset: usize,
)
fn copy_from_interleaved_range( &mut self, input: &[T], start: usize, end: usize, offset: usize, )
Copies a range from an interleaved input buffer, starting at an offset. Read more
Source§fn channel_layout(&self) -> AudioChannelLayout
fn channel_layout(&self) -> AudioChannelLayout
Returns the current channel layout.
Source§fn set_channel_layout(&mut self, new_layout: AudioChannelLayout)
fn set_channel_layout(&mut self, new_layout: AudioChannelLayout)
Sets a new channel layout, converting the audio signal into new layout.
Source§fn len_interleaved(&self) -> usize
fn len_interleaved(&self) -> usize
Returns the total interleaved length (channels * planar length).
Source§fn to_f32(&self) -> AudioBuffer<f32>
fn to_f32(&self) -> AudioBuffer<f32>
Converts this buffer to a cloned AudioBuffer with f32 samples.
Source§fn to_f64(&self) -> AudioBuffer<f64>
fn to_f64(&self) -> AudioBuffer<f64>
Converts this buffer to a cloned AudioBuffer with f64 samples.
Source§impl<T: FloatType> AudioBufferMathImpl<T> for AudioBuffer<T>
impl<T: FloatType> AudioBufferMathImpl<T> for AudioBuffer<T>
Source§impl<T: Clone + FloatType> Clone for AudioBuffer<T>
impl<T: Clone + FloatType> Clone for AudioBuffer<T>
Source§fn clone(&self) -> AudioBuffer<T>
fn clone(&self) -> AudioBuffer<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<T> Freeze for AudioBuffer<T>
impl<T> RefUnwindSafe for AudioBuffer<T>where
T: RefUnwindSafe,
impl<T> Send for AudioBuffer<T>where
T: Send,
impl<T> Sync for AudioBuffer<T>where
T: Sync,
impl<T> Unpin for AudioBuffer<T>where
T: Unpin,
impl<T> UnwindSafe for AudioBuffer<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more