Struct Buffered Playback
pub struct BufferedPlayback { /* private fields */ }Expand description
Prepared consumer transport. Render/play/pause perform no heap, lock or I/O. Queue-source position advances only for consumed frames; underruns stall it. Paused renders do not consume the ring. Output always fills with audio plus silence. The endpoint itself provides no device clock, rate conversion, crossfade, looping or live seek. A worker can explicitly convert into its queue rate. Serialize commands with this exclusive endpoint on its owning audio thread; destruction follows callback shutdown. Worker status snapshots may change concurrently. A stopped seek belongs to the control owner with this endpoint reclaimed after callback stop, never inside render.
Implementations§
§impl BufferedPlayback
impl BufferedPlayback
pub fn maximum_render_frames(&self) -> usize
pub fn maximum_render_frames(&self) -> usize
Fixed prepared render bound in queue-source output frames.
pub fn sample_rate(&self) -> u32
pub fn channels(&self) -> usize
pub fn position_frames(&self) -> u64
pub fn is_playing(&self) -> bool
pub fn queued_frames(&self) -> usize
pub fn worker_status(&self) -> ReadAheadStatus
pub fn play(&mut self)
pub fn pause(&mut self)
pub fn render(
&mut self,
output: &mut [f32],
) -> Result<BufferedPlaybackProgress, PlaybackError>
pub fn render( &mut self, output: &mut [f32], ) -> Result<BufferedPlaybackProgress, PlaybackError>
Invalid/oversized shapes or conservative u64 cursor-addition overflow silence the complete supplied buffer and preserve cursor/play state/queue. Zero frames preserve play/pause. After complete worker publication, EOF is reported only once the queue drains. Faults may leave earlier queued audio: consume it once, then stop, reporting Failed.