pub trait AudioProcessor {
type SampleType;
// Required method
fn process<BufferType: AudioBuffer<SampleType = Self::SampleType>>(
&mut self,
_context: &mut AudioContext,
data: &mut BufferType
);
// Provided method
fn prepare(
&mut self,
_context: &mut AudioContext,
_settings: AudioProcessorSettings
) { ... }
}
Expand description
Represents an audio processing node.
Implementors should define the SampleType the node will work over. See some examples here.
Required Associated Types§
type SampleType
Required Methods§
sourcefn process<BufferType: AudioBuffer<SampleType = Self::SampleType>>(
&mut self,
_context: &mut AudioContext,
data: &mut BufferType
)
fn process<BufferType: AudioBuffer<SampleType = Self::SampleType>>( &mut self, _context: &mut AudioContext, data: &mut BufferType )
Process a block of samples by mutating the input AudioBuffer
Provided Methods§
sourcefn prepare(
&mut self,
_context: &mut AudioContext,
_settings: AudioProcessorSettings
)
fn prepare( &mut self, _context: &mut AudioContext, _settings: AudioProcessorSettings )
Prepare for playback based on current audio settings