pub trait Reader<S>: Send + Syncwhere
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§
Sourcefn sample_rate(&self) -> f64
fn sample_rate(&self) -> f64
Get the sample rate of the audio file being read.
Sourcefn num_channels(&self) -> usize
fn num_channels(&self) -> usize
Get the number of channels in the audio file being read.
Sourcefn num_samples(&self) -> usize
fn num_samples(&self) -> usize
Get the number of samples in the audio file being read.
Sourcefn read_channel(&self, channel_index: usize) -> &[S]
fn read_channel(&self, channel_index: usize) -> &[S]
Read samples from a specific channel of the audio file.