pub struct AudioBuffer<S>where
S: Sample,{ /* private fields */ }Expand description
A buffer for storing audio sample data.
Used internally by the DSP graph for block input/output buffers.
Wraps a Vec<S> with convenience methods for audio processing.
Implementations§
Source§impl<S> AudioBuffer<S>where
S: Sample,
impl<S> AudioBuffer<S>where
S: Sample,
Sourcepub fn new(capacity: usize) -> AudioBuffer<S>
pub fn new(capacity: usize) -> AudioBuffer<S>
Create an AudioBuffer of a particular capacity,
automatically filled with zeroes.
Sourcepub fn with_data(data: Vec<S>) -> AudioBuffer<S>
pub fn with_data(data: Vec<S>) -> AudioBuffer<S>
Create an AudioBuffer initialized with a given set of values.
Sourcepub fn copy_from_slice(&mut self, source: &[S])
pub fn copy_from_slice(&mut self, source: &[S])
Copy the values from a given source to the AudioBuffer.
Sourcepub fn copy_to_slice(&self, target: &mut [S])
pub fn copy_to_slice(&self, target: &mut [S])
Copy the AudioBuffer’s values to a given slice.
Sourcepub fn as_mut_ptr(&mut self) -> *mut S
pub fn as_mut_ptr(&mut self) -> *mut S
Get the AudioBuffer as a mutable pointer to its contents.
Sourcepub fn extend_from_slice(&mut self, slice: &[S])
pub fn extend_from_slice(&mut self, slice: &[S])
Append the AudioBuffer with data from a given slice.
Sourcepub fn drain_front(&mut self, count: usize) -> Drain<'_, S>
pub fn drain_front(&mut self, count: usize) -> Drain<'_, S>
Drain the first count values from the AudioBuffer.
Trait Implementations§
Source§impl<S> Buffer<S> for AudioBuffer<S>where
S: Sample,
impl<S> Buffer<S> for AudioBuffer<S>where
S: Sample,
Source§fn as_mut_slice(&mut self) -> &mut [S]
fn as_mut_slice(&mut self) -> &mut [S]
Get the
Buffer as a mutable data slice.Source§impl<S> Clone for AudioBuffer<S>
impl<S> Clone for AudioBuffer<S>
Source§fn clone(&self) -> AudioBuffer<S>
fn clone(&self) -> AudioBuffer<S>
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 moreSource§impl<S> Debug for AudioBuffer<S>
impl<S> Debug for AudioBuffer<S>
Source§impl<S> Extend<S> for AudioBuffer<S>where
S: Sample,
impl<S> Extend<S> for AudioBuffer<S>where
S: Sample,
Source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = S>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = S>,
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Auto Trait Implementations§
impl<S> Freeze for AudioBuffer<S>
impl<S> RefUnwindSafe for AudioBuffer<S>where
S: RefUnwindSafe,
impl<S> Send for AudioBuffer<S>
impl<S> Sync for AudioBuffer<S>
impl<S> Unpin for AudioBuffer<S>where
S: Unpin,
impl<S> UnwindSafe for AudioBuffer<S>where
S: 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