Struct rsynth::buffer::AudioChunk
source · pub struct AudioChunk<S> { /* private fields */ }
Implementations§
source§impl<S> AudioChunk<S>
impl<S> AudioChunk<S>
sourcepub fn zero(number_of_channels: usize, number_of_frames: usize) -> Selfwhere
S: Zero,
pub fn zero(number_of_channels: usize, number_of_frames: usize) -> Selfwhere
S: Zero,
Note: cannot be used in a real-time context
This method allocates memory and cannot be used in a real-time context.
pub fn from_channels(channels: Vec<Vec<S>>) -> Self
sourcepub fn new(number_of_channels: usize) -> Self
pub fn new(number_of_channels: usize) -> Self
Note: cannot be used in a real-time context
This method allocates memory and cannot be used in a real-time context.
sourcepub fn with_capacity(number_of_channels: usize, capacity: usize) -> Self
pub fn with_capacity(number_of_channels: usize, capacity: usize) -> Self
Create a new AudioChunk
in which each channel has the given capacity.
This allows to append capacity
frames to the AudioChunk
(e.g. by calling
append_sliced_chunk
).
Note: cannot be used in a real-time context
This method allocates memory and cannot be used in a real-time context.
pub fn channels(&self) -> &Vec<Vec<S>>
sourcepub fn append_sliced_chunk(&mut self, chunk: &[&[S]])where
S: Clone,
pub fn append_sliced_chunk(&mut self, chunk: &[&[S]])where
S: Clone,
Note about using in a real-time context
This method will allocate memory if the capacity of the chunk is exceeded and cannot be used in a real-time context in that case.
pub fn inner(self) -> Vec<Vec<S>>
sourcepub fn as_slices<'a>(&'a self) -> Vec<&[S]>
pub fn as_slices<'a>(&'a self) -> Vec<&[S]>
Note: cannot be used in a real-time context
This method allocates memory and cannot be used in a real-time context.
sourcepub fn as_mut_slices<'a>(&'a mut self) -> Vec<&mut [S]>
pub fn as_mut_slices<'a>(&'a mut self) -> Vec<&mut [S]>
Note: cannot be used in a real-time context
This method allocates memory and cannot be used in a real-time context.
sourcepub fn split(self, number_of_frames_per_chunk: usize) -> Vec<Self>
pub fn split(self, number_of_frames_per_chunk: usize) -> Vec<Self>
Note: cannot be used in a real-time context
This method allocates memory and cannot be used in a real-time context.
Trait Implementations§
source§impl<S: Clone> Clone for AudioChunk<S>
impl<S: Clone> Clone for AudioChunk<S>
source§fn clone(&self) -> AudioChunk<S>
fn clone(&self) -> AudioChunk<S>
Returns a copy 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> Debug for AudioChunk<S>
impl<S: Debug> Debug for AudioChunk<S>
source§impl<S: PartialEq> PartialEq for AudioChunk<S>
impl<S: PartialEq> PartialEq for AudioChunk<S>
source§fn eq(&self, other: &AudioChunk<S>) -> bool
fn eq(&self, other: &AudioChunk<S>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<S: Eq> Eq for AudioChunk<S>
impl<S> StructuralEq for AudioChunk<S>
impl<S> StructuralPartialEq for AudioChunk<S>
Auto Trait Implementations§
impl<S> RefUnwindSafe for AudioChunk<S>where
S: RefUnwindSafe,
impl<S> Send for AudioChunk<S>where
S: Send,
impl<S> Sync for AudioChunk<S>where
S: Sync,
impl<S> Unpin for AudioChunk<S>where
S: Unpin,
impl<S> UnwindSafe for AudioChunk<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