Skip to main content

IoPlayback

Trait IoPlayback 

Source
pub trait IoPlayback: Send + Sync {
    // Required methods
    fn write_output(&self, channel: usize, src: &[f32]) -> usize;
    fn num_output_channels(&self) -> usize;
}
Expand description

A backend that plays (writes) signal data to hardware.

Nodes of type rill/output hold an Arc<dyn IoPlayback> and call write_output directly from consume().

Required Methods§

Source

fn write_output(&self, channel: usize, src: &[f32]) -> usize

Write output samples for one channel from src.

Returns the number of samples actually written (may be less than src.len() if insufficient space is available).

Source

fn num_output_channels(&self) -> usize

Number of playback channels.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§