pub struct AudioChunk {
pub samples: Arc<[f32]>,
pub format: AudioFormat,
}Expand description
A chunk of f32 PCM audio tagged with its own AudioFormat.
Immutable like every DataFrame: aggregate chunks and produce a new one
rather than mutating in place. samples are interleaved by channel; for the
common mono case that is just a flat sample buffer.
Fields§
§samples: Arc<[f32]>Interleaved f32 PCM samples.
format: AudioFormatThe rate and channel count these samples are in.
Implementations§
Source§impl AudioChunk
impl AudioChunk
Sourcepub fn new(samples: Arc<[f32]>, format: AudioFormat) -> AudioChunk
pub fn new(samples: Arc<[f32]>, format: AudioFormat) -> AudioChunk
Bundle samples with the format they are in.
Trait Implementations§
Source§impl Clone for AudioChunk
impl Clone for AudioChunk
Source§fn clone(&self) -> AudioChunk
fn clone(&self) -> AudioChunk
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AudioChunk
impl Debug for AudioChunk
Source§impl PartialEq for AudioChunk
impl PartialEq for AudioChunk
impl StructuralPartialEq for AudioChunk
Auto Trait Implementations§
impl Freeze for AudioChunk
impl RefUnwindSafe for AudioChunk
impl Send for AudioChunk
impl Sync for AudioChunk
impl Unpin for AudioChunk
impl UnsafeUnpin for AudioChunk
impl UnwindSafe for AudioChunk
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