pub trait AudioProcessor {
type SampleType: Sized;
// Required method
fn process(
&mut self,
_context: &mut AudioContext,
data: &mut AudioBuffer<Self::SampleType>,
);
// Provided method
fn prepare(&mut self, _context: &mut AudioContext) { ... }
}
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: Sized
Required Methods§
Sourcefn process(
&mut self,
_context: &mut AudioContext,
data: &mut AudioBuffer<Self::SampleType>,
)
fn process( &mut self, _context: &mut AudioContext, data: &mut AudioBuffer<Self::SampleType>, )
Process a block of samples by mutating the input AudioBuffer
Provided Methods§
Sourcefn prepare(&mut self, _context: &mut AudioContext)
fn prepare(&mut self, _context: &mut AudioContext)
Prepare for playback based on current audio settings