Struct Aiff Reader
pub struct AiffReader<R> { /* private fields */ }Expand description
Prepared interleaved f32 reader over a seekable uncompressed AIFF stream. Unknown chunks are skipped within FORM (at most 4096 chunks). COMM/SSND must be unique and consistent; zero frames may omit SSND. Its offset is honored but nonzero blockSize rejects. Trailing bytes outside FORM are ignored. No metadata/loop markers are exposed.
Implementations§
§impl<R: Read + Seek> AiffReader<R>
impl<R: Read + Seek> AiffReader<R>
pub fn new(source: R, maximum_frames: usize) -> Result<Self, AudioFileError>
pub fn new(source: R, maximum_frames: usize) -> Result<Self, AudioFileError>
Inspect from offset zero, validate container and allocate bounded scratch.
pub fn format(&self) -> AiffFormat
pub fn frames(&self) -> u64
pub fn position(&self) -> u64
pub fn maximum_frames(&self) -> usize
pub fn seek_frame(&mut self, frame: u64) -> Result<(), AudioFileError>
pub fn seek_frame(&mut self, frame: u64) -> Result<(), AudioFileError>
Set a frame in 0..=frames; actual file seek occurs on the next read.
pub fn read_frames(
&mut self,
output: &mut [f32],
) -> Result<usize, AudioFileError>
pub fn read_frames( &mut self, output: &mut [f32], ) -> Result<usize, AudioFileError>
Decode bounded complete frames, preserving unused output tail. On read failure, destination and logical position remain unchanged for retry.