pub trait RawStreamingDataSource:
Iterator<Item = f32>
+ Send
+ Sync
+ Debug {
// Required methods
fn sample_rate(&self) -> usize;
fn channel_count(&self) -> usize;
// Provided methods
fn rewind(&mut self) -> Result<(), SoundError> { ... }
fn time_seek(&mut self, _duration: Duration) { ... }
fn duration(&self) -> Option<Duration> { ... }
}Expand description
A samples generator.
§Notes
Iterator implementation (the next() method) must produce samples in interleaved format, this
means that samples emitted by the method should be in LRLRLR.. order, where L and R are
samples from left and right channels respectively. The sound engine supports both mono and
stereo sample sources.
Required Methods§
Sourcefn sample_rate(&self) -> usize
fn sample_rate(&self) -> usize
Should return sample rate of the source.
Sourcefn channel_count(&self) -> usize
fn channel_count(&self) -> usize
Should return total channel count.
Provided Methods§
Sourcefn rewind(&mut self) -> Result<(), SoundError>
fn rewind(&mut self) -> Result<(), SoundError>
Tells whether the provider should restart.