pub trait AudioReader<S>
where S: Copy,
{ type Err; // Required methods fn number_of_channels(&self) -> usize; fn frames_per_second(&self) -> u64; fn fill_buffer( &mut self, output: &mut AudioBufferOut<'_, '_, S> ) -> Result<usize, Self::Err>; }
Expand description

Define how audio is read.

This trait is generic over S, which represents the data-type used for a sample.

Required Associated Types§

source

type Err

The type of the error that occurs when reading data.

Required Methods§

source

fn number_of_channels(&self) -> usize

The number of audio channels that can be read.

source

fn frames_per_second(&self) -> u64

The sampling frequency in frames per second.

source

fn fill_buffer( &mut self, output: &mut AudioBufferOut<'_, '_, S> ) -> Result<usize, Self::Err>

Fill the buffers. Return the number of frames that have been read and written to the buffer. If the return value is < the number of frames in the input, no more frames can be expected.

Implementors§

source§

impl<'b, S> AudioReader<S> for AudioBufferReader<'b, S>
where S: Copy,

source§

impl<'b, S> AudioReader<S> for TestAudioReader<'b, S>
where S: Copy,

source§

impl<'wr, S> AudioReader<S> for HoundAudioReader<'wr, S>

§

type Err = Error

source§

impl<S> AudioReader<S> for AudioDummy<S>
where S: Copy,