Trait oxcable::types::AudioDevice [] [src]

pub trait AudioDevice {
    fn num_inputs(&self) -> usize;
    fn num_outputs(&self) -> usize;
    fn tick(&mut self, t: Time, inputs: &[Sample], outputs: &mut [Sample]);
}

A device that processes and/or generates audio.

Required Methods

fn num_inputs(&self) -> usize

Returns the number of input channels the device accepts.

fn num_outputs(&self) -> usize

Return sthe number of output channels the device returns.

fn tick(&mut self, t: Time, inputs: &[Sample], outputs: &mut [Sample])

Processes a single frame worth of audio data. This function should be called once per time step, starting at t=0.

If a device accepts no inputs, or generates no outputs, then zero length slices may be passed in.

Implementors