pub trait AudioGenerator {
// Required method
fn process(&mut self, frames: &mut [[f32; 2]]);
// Provided methods
fn init(&mut self, _process_chunk_size: usize) { ... }
fn process_midi(&mut self, _message: &[u8], _timestamp: u64) { ... }
}Expand description
Trait to be implemented by structs that are passed as generator to the shell.
Required Methods§
Provided Methods§
Sourcefn init(&mut self, _process_chunk_size: usize)
fn init(&mut self, _process_chunk_size: usize)
Initializes the generator. Called once on invocation.
process_chunk_sizeis the number of frames passed to theprocessfunction.
Sourcefn process_midi(&mut self, _message: &[u8], _timestamp: u64)
fn process_midi(&mut self, _message: &[u8], _timestamp: u64)
Processes a MIDI message.