pub struct IntegerFileDecoder { /* private fields */ }Expand description
Decode native FLAC or PCM WAV without converting the source to floating PCM.
The initial profile accepts integer 16/24-bit mono/stereo sources. Values
returned in i32 containers retain their source-depth scale, interleaved
channel order and rate. This is a source API, not an audio sink or a claim
about operating-system/device output. No DSP, FFmpeg or fallback is used.
Implementations§
Source§impl IntegerFileDecoder
impl IntegerFileDecoder
Sourcepub fn open(path: &Path) -> Result<Self, Error>
pub fn open(path: &Path) -> Result<Self, Error>
Inspect and decode the same opened regular file; extensions are not trusted.
Sourcepub fn format(&self) -> IntegerPcmFormat
pub fn format(&self) -> IntegerPcmFormat
Original rate, valid precision and channel association.
Sourcepub fn flac_md5_status(&self) -> Option<FlacMd5Status>
pub fn flac_md5_status(&self) -> Option<FlacMd5Status>
FLAC verification status for this decode pass, finalized only at EOF.
Sourcepub fn read_frames(&mut self, output: &mut [i32]) -> Result<usize, Error>
pub fn read_frames(&mut self, output: &mut [i32]) -> Result<usize, Error>
Read complete interleaved frames into a caller-owned integer buffer.
A short read is normal; only Ok(0) establishes successful EOF. Empty
or non-frame-aligned buffers are rejected without advancing the source
or mutating the buffer. Unused output elements stay unchanged.
Sourcepub fn skip_frames(
&mut self,
frames: u64,
cancelled: impl FnMut() -> bool,
) -> Result<SeekResult, Error>
pub fn skip_frames( &mut self, frames: u64, cancelled: impl FnMut() -> bool, ) -> Result<SeekResult, Error>
Progressively discard source frames for a later explicitly requested seek.
No output, DSP or listening history is produced. FLAC verification includes the discarded prefix. Working memory stays bounded, but work grows with the traversed audio. Cancellation is polled before decoding and after at most 4096 discarded frames; a decoder/I/O call may block. Discard this decoder after cancellation or failure rather than treating a partially advanced position as a successful seek.