Skip to main content

Module buffer

Module buffer 

Source
Expand description

Multi-channel audio buffers in interleaved or deinterleaved layout. Multi-channel audio buffers.

A buffer is a flat slice of samples plus a BufferInfo recording how many channels and frames it holds. The layout is a type parameter: Interleaved stores one sample per channel per frame (what most audio APIs use), while Deinterleaved stores each channel contiguously.

Encoding a layout in the type rather than a runtime flag means indexing is resolved at compile time and the two cannot be mixed up. FromBytes and ToByteBufferRef convert to and from raw bytes in a caller-chosen endianness.

Re-exports§

pub use info::BufferInfo;
pub use layout::BufferLayout;

Modules§

info
Channel and frame counts for a buffer.
layout
The interleaved and deinterleaved buffer layouts.

Structs§

Buffer
Buffer multi-channel interlaced Audio.
BufferRef
A borrowed view of multi-channel audio: samples of type T in layout L.

Enums§

Error
Errors from converting between buffers and raw bytes.

Traits§

FromBytes
Decodes a buffer from raw little- or big-endian bytes.
ToByteBufferRef
Encodes a buffer into raw bytes in a caller-chosen endianness.