AUDIO
Source snapshot · 11 November 2026

API reference / ravet_audio_file::PlaybackReader

Trait PlaybackReader 

pub trait PlaybackReader {
    // Required methods
    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>;
}
Expand description

A stable metadata/committed-frame interface for control/worker file preparation. Metadata getters must not read/seek. Successful reads advance position by exactly the returned complete frames; errors expose their actual committed frame position, which can have advanced. No rollback is implied. A zero read means validated EOF; compressed implementations must retain gapless trimming. Implementations own their original I/O/codec errors and source bounds.

Required Methods§

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>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

§

impl PlaybackReader for CompressedReader

Available on crate feature compressed only.
§

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

§

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