pub trait AudioNodeProcessor: 'static + Send {
// Required method
fn process(
&mut self,
info: &ProcInfo,
buffers: ProcBuffers<'_, '_>,
events: &mut ProcEvents<'_>,
extra: &mut ProcExtra,
) -> ProcessStatus;
// Provided methods
fn stream_stopped(&mut self, logger: &mut RealtimeLogger) { ... }
fn new_stream(&mut self, stream_info: &StreamInfo) { ... }
}Expand description
The trait describing the realtime processor counterpart to an audio node.
Required Methods§
Sourcefn process(
&mut self,
info: &ProcInfo,
buffers: ProcBuffers<'_, '_>,
events: &mut ProcEvents<'_>,
extra: &mut ProcExtra,
) -> ProcessStatus
fn process( &mut self, info: &ProcInfo, buffers: ProcBuffers<'_, '_>, events: &mut ProcEvents<'_>, extra: &mut ProcExtra, ) -> ProcessStatus
Process the given block of audio. Only process data in the
buffers up to samples.
The node MUST either return ProcessStatus::ClearAllOutputs
or fill all output buffers with data.
If any output buffers contain all zeros up to samples (silent),
then mark that buffer as silent in ProcInfo::out_silence_mask.
info- Information about this processing block.buffers- The buffers of data to process.events- A list of events for this node to process.extra- Additional buffers and utilities.
Provided Methods§
Sourcefn stream_stopped(&mut self, logger: &mut RealtimeLogger)
fn stream_stopped(&mut self, logger: &mut RealtimeLogger)
Called when the audio stream has been stopped.
Sourcefn new_stream(&mut self, stream_info: &StreamInfo)
fn new_stream(&mut self, stream_info: &StreamInfo)
Called when a new audio stream has been started after a previous
call to AudioNodeProcessor::stream_stopped.
Note, this method gets called on the main thread, not the audio thread. So it is safe to allocate/deallocate here.