Trait audio_streams::PlaybackBufferStream
source · pub trait PlaybackBufferStream: Send {
// Required method
fn next_playback_buffer<'b, 's: 'b>(
&'s mut self
) -> Result<PlaybackBuffer<'b>, BoxError>;
// Provided method
fn write_playback_buffer<'b, 's: 'b>(
&'s mut self,
f: &mut dyn FnMut(&mut PlaybackBuffer<'b>) -> Result<(), BoxError>
) -> Result<(), BoxError> { ... }
}
Expand description
PlaybackBufferStream
provides PlaybackBuffer
s to fill with audio samples for playback.
Required Methods§
fn next_playback_buffer<'b, 's: 'b>( &'s mut self ) -> Result<PlaybackBuffer<'b>, BoxError>
Provided Methods§
sourcefn write_playback_buffer<'b, 's: 'b>(
&'s mut self,
f: &mut dyn FnMut(&mut PlaybackBuffer<'b>) -> Result<(), BoxError>
) -> Result<(), BoxError>
fn write_playback_buffer<'b, 's: 'b>( &'s mut self, f: &mut dyn FnMut(&mut PlaybackBuffer<'b>) -> Result<(), BoxError> ) -> Result<(), BoxError>
Call f
with a PlaybackBuffer
, and trigger the buffer done call back after. f
should
write playback data to the given PlaybackBuffer
.