Trait rsynth::backend::combined::AudioReader
source · 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§
Required Methods§
sourcefn number_of_channels(&self) -> usize
fn number_of_channels(&self) -> usize
The number of audio channels that can be read.
sourcefn frames_per_second(&self) -> u64
fn frames_per_second(&self) -> u64
The sampling frequency in frames per second.
sourcefn fill_buffer(
&mut self,
output: &mut AudioBufferOut<'_, '_, S>
) -> Result<usize, Self::Err>
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.