Skip to main content

AudioOut

Trait AudioOut 

Source
pub trait AudioOut: Send {
    // Required methods
    fn configure(&mut self, rate: u32, channels: u32);
    fn push_le_f32(&mut self, bytes: &[u8]);

    // Provided method
    fn media_bus(&self) -> Option<Arc<MediaBus>> { ... }
}
Expand description

Where the host sends audio_push samples. Send: the host lives in the wasmtime store, which async (gasm_run) calls require to be Send.

Required Methods§

Source

fn configure(&mut self, rate: u32, channels: u32)

Source format of the following pushes (validated by the host).

Source

fn push_le_f32(&mut self, bytes: &[u8])

Interleaved little-endian f32 samples in the configured format.

Provided Methods§

Source

fn media_bus(&self) -> Option<Arc<MediaBus>>

The bus gasm:media streams play into (added after these samples), if this output has one.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§