pub trait AudioSource: Send {
// Required method
fn next_frame(
&mut self,
) -> impl Future<Output = Option<AudioFrame<'static>>> + Send;
}Expand description
Produces owned AudioFrames. next_frame().await returns the
next frame when one is available, or None once the source has
run out (file ended, device closed, dialogue terminated). Each
frame’s AudioFrame::sample_rate is set by the implementation —
consumers resample as needed.
Required Methods§
fn next_frame( &mut self, ) -> impl Future<Output = Option<AudioFrame<'static>>> + Send
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.