pub trait AudioMixBus: Send + Sync {
// Required methods
fn stream_info(&self) -> StreamInfo;
fn write_block(&self, samples: &[f32]);
fn pull(&self, out: &mut [f32]);
}Expand description
The contract between audio-producing lanes and the audio backend.
All methods are &self so the bus can sit inside an Arc shared by
multiple lanes (writers) and the backend’s callback (single reader).
Required Methods§
Sourcefn stream_info(&self) -> StreamInfo
fn stream_info(&self) -> StreamInfo
Channel count and sample rate negotiated with the device.
Lanes use this to size their writes (frames × channels) and to avoid sample-rate conversion mismatches.
Sourcefn write_block(&self, samples: &[f32])
fn write_block(&self, samples: &[f32])
Push interleaved PCM samples produced by an audio lane.
samples.len() must be a multiple of stream_info().channels.
Implementations may drop the oldest data on overflow — audio is
real-time and stale samples are worse than silence.