pub trait AudioSource: Send {
// Required methods
fn channels(&self) -> u16;
fn sample_rate(&self) -> u32;
fn duration(&self) -> Option<f64>;
fn next_block(&mut self) -> Option<Block<'_>>;
fn seek(&mut self, secs: f64) -> Result<f64, AudioError>;
fn position(&self) -> f64;
fn backend(&self) -> &'static str;
}Expand description
A decoded audio stream.
Required Methods§
Sourcefn sample_rate(&self) -> u32
fn sample_rate(&self) -> u32
Frames per second.
Sourcefn next_block(&mut self) -> Option<Block<'_>>
fn next_block(&mut self) -> Option<Block<'_>>
The next block of samples, or None at the end.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".