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
fn total_length(&self) -> u32
fn total_length(&self) -> u32
Gets the total length of the stream in seconds.
fn next_sample(&mut self) -> Sample
fn next_sample(&mut self) -> Sample
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
fn sample_rate(&self) -> u32
fn sample_rate(&self) -> u32
Gets the sample rate.