Trait rmus::traits::Source[][src]

pub trait Source {
    fn total_length(&self) -> u32;
fn next_sample(&mut self) -> Sample;
fn sample_rate(&self) -> u32;
fn channels(&self) -> u8;
fn goto(&self, pos: u64); }
Expand description

A trait that is used as a source of samples

Required methods

Gets the total length of the stream in seconds.

Gets the next sample in the buffer. This has to be interleaved and, of course, buffered, so the channels are in backwards order. This is because interleaved is probably faster than iterating through Vec<VecDeque> and having the samples buffered ensures that no underrun occurs.

Gets the sample rate.

Gets the number of channels in the source.

Jumps to a certain location in the file. The position is to be handled in number of samples.

Implementors