Skip to main content

IoCapture

Trait IoCapture 

Source
pub trait IoCapture: Send + Sync {
    // Required methods
    fn read_input(&self, channel: usize, dst: &mut [f32]) -> usize;
    fn num_input_channels(&self) -> usize;
}
Expand description

A backend that captures (reads) signal data from hardware.

Nodes of type rill/input hold an Arc<dyn IoCapture> and call read_input directly from generate().

A capture backend may or may not also be the driver. When it is not the driver, the driver’s callback ensures that fresh capture data is available before the graph runs (e.g. PipeWire processes all streams in the same cycle).

Required Methods§

Source

fn read_input(&self, channel: usize, dst: &mut [f32]) -> usize

Read captured samples for one channel into dst.

Returns the number of samples actually read (may be less than dst.len() if insufficient data is available).

Source

fn num_input_channels(&self) -> usize

Number of capture channels.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§