AUDIO
Source snapshot · 11 November 2026

API reference / ravet_audio_file::AiffReader

Struct AiffReader 

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>

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>

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>

Decode bounded complete frames, preserving unused output tail. On read failure, destination and logical position remain unchanged for retry.

Trait Implementations§

§

impl<R: Read + Seek> IndexedPlaybackReader for AiffReader<R>

§

fn seek_original_frame(&mut self, frame: u64) -> Result<(), Error>

§

impl<R: Read + Seek> PlaybackReader for AiffReader<R>

§

fn channels(&self) -> usize

§

fn sample_rate(&self) -> u32

§

fn position_frames(&self) -> u64

§

fn declared_frames(&self) -> Option<u64>

§

fn maximum_read_frames(&self) -> usize

§

fn read_frames(&mut self, output: &mut [f32]) -> Result<usize, Error>

Auto Trait Implementations§

§

impl<R> Freeze for AiffReader<R>
where R: Freeze,

§

impl<R> RefUnwindSafe for AiffReader<R>
where R: RefUnwindSafe,

§

impl<R> Send for AiffReader<R>
where R: Send,

§

impl<R> Sync for AiffReader<R>
where R: Sync,

§

impl<R> Unpin for AiffReader<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for AiffReader<R>
where R: UnsafeUnpin,

§

impl<R> UnwindSafe for AiffReader<R>
where R: UnwindSafe,

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<F, T> IntoSample<T> for Fwhere T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.