pub trait SoundStream: Send {
// Required methods
fn get_data(&mut self) -> (&[i16], bool);
fn seek(&mut self, offset: Time);
fn channel_count(&self) -> u32;
fn sample_rate(&self) -> u32;
}Expand description
Trait for streamed audio sources.
The implementor must be able to be sent to another thread, so it must
implement Send.
Required Methods§
Sourcefn get_data(&mut self) -> (&[i16], bool)
fn get_data(&mut self) -> (&[i16], bool)
Request a new chunk of audio samples from the stream source.
Returns (chunk, keep_playing), where chunk is the chunk of audio samples,
and keep_playing tells the streaming loop whether to keep playing or to stop.
Sourcefn channel_count(&self) -> u32
fn channel_count(&self) -> u32
Return the number of channels of the stream.
Sourcefn sample_rate(&self) -> u32
fn sample_rate(&self) -> u32
Get the stream sample rate of the stream.