pub trait SimpleAudioProcessor {
type SampleType: Copy;
fn s_prepare(&mut self, _settings: AudioProcessorSettings) { ... }
fn s_process(&mut self, sample: Self::SampleType) -> Self::SampleType { ... }
fn s_process_frame(&mut self, frame: &mut [Self::SampleType]) { ... }
}
Expand description
Represents an audio processing node.
Implementors should define the SampleType the node will work over.
Associated Types
type SampleType: Copy
Provided methods
fn s_prepare(&mut self, _settings: AudioProcessorSettings)
fn s_prepare(&mut self, _settings: AudioProcessorSettings)
Prepare for playback based on current audio settings
fn s_process(&mut self, sample: Self::SampleType) -> Self::SampleType
fn s_process(&mut self, sample: Self::SampleType) -> Self::SampleType
Process a single sample. If the input is mult-channel, will run for each channel by default. If the processor is multi-channel, implement s_process_frame instead.
s_process_frame
is what should be called by consumers & its not required to implement a
sound s_process
method.
fn s_process_frame(&mut self, frame: &mut [Self::SampleType])
fn s_process_frame(&mut self, frame: &mut [Self::SampleType])
Process a multi-channel frame.
By default calls s_process.