AUDIO
Source snapshot · 11 November 2026

API reference / ravet_audio_file::AiffWriter

Struct AiffWriter 

pub struct AiffWriter<W> { /* private fields */ }
Expand description

Bounded uncompressed AIFF writer. Destination must initially be empty. Call finish explicitly to patch counts/sizes; Drop performs no I/O. Partial I/O failures poison the writer; discard the partial file.

Implementations§

§

impl<W: Write + Seek> AiffWriter<W>

pub fn new( destination: W, format: AiffFormat, maximum_frames: usize, ) -> Result<Self, AudioFileError>

pub fn frames(&self) -> u64

pub fn write_frames(&mut self, input: &[f32]) -> Result<(), AudioFileError>

Validate all samples before I/O; finite PCM clips to [-1,1] and rounds to nearest integer. Partial frames, NaN/infinity and oversized blocks reject.

pub fn finish(self) -> Result<W, AudioFileError>

Add odd-data padding, patch FORM/COMM/SSND sizes and flush.

Auto Trait Implementations§

§

impl<W> Freeze for AiffWriter<W>
where W: Freeze,

§

impl<W> RefUnwindSafe for AiffWriter<W>
where W: RefUnwindSafe,

§

impl<W> Send for AiffWriter<W>
where W: Send,

§

impl<W> Sync for AiffWriter<W>
where W: Sync,

§

impl<W> Unpin for AiffWriter<W>
where W: Unpin,

§

impl<W> UnsafeUnpin for AiffWriter<W>
where W: UnsafeUnpin,

§

impl<W> UnwindSafe for AiffWriter<W>
where W: 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.