Skip to main content

extract_pb_settings

Function extract_pb_settings 

Source
pub(crate) fn extract_pb_settings(s: &Bound<'_, PyAny>) -> PyResult<PbSettings>
Expand description

Read a Python AudioPlaybackSettings into a Rust PbSettings by attribute name, rejecting with ValueError what the playback thread could only fail on later.

latency_ms must be positive: it sizes the sink buffer, and a zero target would make PulseAudio start playback with nothing prebuffered and underrun on every write. max_buffer_bytes must be positive: it bounds the drop-oldest queue, and a zero bound would discard every chunk as soon as it was queued.