pub enum BlockLayout {
Interleaved,
Planar,
Sequential,
}Expand description
Represents the memory layout of audio data returned by AudioBlock::layout.
This enum allows consumers to determine the underlying data layout, which is essential for:
- Direct raw data access
- Performance optimizations
- Efficient interfacing with external audio APIs
§Examples of layouts
Each variant represents a common pattern used in audio processing.
Variants§
Interleaved
Samples from different channels alternate in sequence.
Format: [ch0, ch1, ..., ch0, ch1, ..., ch0, ch1, ...]
This layout is common in consumer audio formats and some APIs.
Planar
Channels are separated into discrete chunks of memory.
Format: [[ch0, ch0, ch0, ...], [ch1, ch1, ch1, ...]]
Useful for operations that work on one channel at a time.
Sequential
All samples from one channel appear consecutively before the next channel.
Format: [ch0, ch0, ch0, ..., ch1, ch1, ch1, ...]
Also known as “planar” format in some audio libraries.
Trait Implementations§
Source§impl Debug for BlockLayout
impl Debug for BlockLayout
Source§impl PartialEq for BlockLayout
impl PartialEq for BlockLayout
impl StructuralPartialEq for BlockLayout
Auto Trait Implementations§
impl Freeze for BlockLayout
impl RefUnwindSafe for BlockLayout
impl Send for BlockLayout
impl Sync for BlockLayout
impl Unpin for BlockLayout
impl UnwindSafe for BlockLayout
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