Trait Reader

Source
pub trait Reader<S>: Send + Sync
where S: Sample,
{ // Required methods fn sample_rate(&self) -> f64; fn num_channels(&self) -> usize; fn num_samples(&self) -> usize; fn read_channel(&self, channel_index: usize) -> &[S]; }
Expand description

Trait for reading audio data from files.

Implementations should load audio data on construction and provide access to the decoded samples via read_channel.

Required Methods§

Source

fn sample_rate(&self) -> f64

Get the sample rate of the audio file being read.

Source

fn num_channels(&self) -> usize

Get the number of channels in the audio file being read.

Source

fn num_samples(&self) -> usize

Get the number of samples in the audio file being read.

Source

fn read_channel(&self, channel_index: usize) -> &[S]

Read samples from a specific channel of the audio file.

Implementors§