Struct Aiff Recorder
pub struct AiffRecorder<W> { /* private fields */ }Expand description
AIFF PCM16/24/32 recorder draining a prepared input ring on a worker. Preparation writes a header to a caller-selected empty seekable sink. Capture callbacks only push frames. A dequeued write failure poisons the recorder; accepted/output prefixes cannot be rolled back. Drop never finalizes or drains. No physical device, path, worker thread, rate conversion or clock is selected.
Implementations§
§impl<W: Write + Seek> AiffRecorder<W>
impl<W: Write + Seek> AiffRecorder<W>
pub fn new(
destination: W,
format: AiffFormat,
maximum_frames: usize,
consumer: AudioConsumer,
) -> Result<Self, AudioFileError>
pub fn new( destination: W, format: AiffFormat, maximum_frames: usize, consumer: AudioConsumer, ) -> Result<Self, AudioFileError>
Validate matching channels before header I/O; scratch capacity 1..65,536. Writer format/count/FORM-size and finite PCM conversion rules still apply.
pub fn pump(&mut self) -> Result<usize, AudioFileError>
pub fn pump(&mut self) -> Result<usize, AudioFileError>
Drain at most scratch capacity. Empty calls perform no file I/O. Any write or PCM validation failure after dequeue poisons future pump/finalization.
pub fn finish(self) -> Result<W, AudioFileError>
pub fn finish(self) -> Result<W, AudioFileError>
Stop/join the producer first. Drain at most one ring capacity, finalize FORM/COMM/SSND lengths and flush. Continuing publication can reject finish or lose late frames; no implicit capture stop or unlimited drain occurs.