pub trait AudioDevice: Send + Sync {
// Required method
fn open(
self: Box<Self>,
mix_bus: Arc<dyn AudioMixBus>,
) -> Result<Box<dyn AudioStream>>;
}Expand description
Factory for an audio output stream.
The device is consumed during AudioDevice::open — backends store
their hardware handles inside the returned AudioStream.
Required Methods§
Sourcefn open(
self: Box<Self>,
mix_bus: Arc<dyn AudioMixBus>,
) -> Result<Box<dyn AudioStream>>
fn open( self: Box<Self>, mix_bus: Arc<dyn AudioMixBus>, ) -> Result<Box<dyn AudioStream>>
Opens the output stream. The backend’s audio callback will pull
samples from mix_bus on a dedicated real-time thread.
The returned handle keeps the stream alive for as long as it exists. Dropping the handle stops the stream.