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§

Required Methods§

source

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§

source

fn prepare( &mut self, _context: &mut AudioContext, _settings: AudioProcessorSettings )

Prepare for playback based on current audio settings

Implementors§

source§

impl<Processor> AudioProcessor for BufferProcessor<Processor>where Processor: SimpleAudioProcessor, <Processor as SimpleAudioProcessor>::SampleType: Copy,

source§

impl<SampleType: Float + Send> AudioProcessor for SilenceAudioProcessor<SampleType>

§

type SampleType = SampleType