Struct Aiff Read Ahead
pub struct AiffReadAhead<R> { /* private fields */ }Expand description
Worker-owned AIFF read-ahead with retained suffixes under ring backpressure. Requires matching channels and 1..65,536 scratch frames within reader capacity. Pump/seek perform file I/O outside callbacks; only prepared consumer pop or BufferedPlayback rendering belongs in audio. No rate conversion is implicit. Wrap in ReadAheadWorker for explicit automatic worker/transport ownership.
Implementations§
§impl<R: Read + Seek> AiffReadAhead<R>
impl<R: Read + Seek> AiffReadAhead<R>
pub fn new( reader: AiffReader<R>, producer: AudioProducer, maximum_frames: usize, ) -> Result<Self, AudioFileError>
pub fn format(&self) -> AiffFormat
pub fn reader_position(&self) -> u64
pub fn reader_position(&self) -> u64
Includes queued/pending frames; this is not an audible sample clock.
pub fn pump(&mut self) -> Result<ReadAheadProgress, AudioFileError>
pub fn pump(&mut self) -> Result<ReadAheadProgress, AudioFileError>
At most one bounded read; retain all unqueued suffixes. Read I/O failure preserves logical position and publication and may be retried explicitly. EOF alone does not mean pending/queued audio has been consumed.
pub fn seek_stopped(
&mut self,
consumer: &mut AudioConsumer,
frame: u64,
) -> Result<(), AudioFileError>
pub fn seek_stopped( &mut self, consumer: &mut AudioConsumer, frame: u64, ) -> Result<(), AudioFileError>
Reclaim matching stopped endpoints. Failed seeks preserve queue/pending/ cursor; successful seeks clear all old-generation audio including scratch.