Trait audio_processor_traits::audio_buffer::AudioBuffer[][src]

pub trait AudioBuffer {
    type SampleType: Float + Sync + Send;
    fn num_channels(&self) -> usize;
fn num_samples(&self) -> usize;
fn get(&self, channel: usize, sample: usize) -> &Self::SampleType;
fn get_mut(
        &mut self,
        channel: usize,
        sample: usize
    ) -> &mut Self::SampleType;
fn set(&mut self, channel: usize, sample: usize, value: Self::SampleType); fn iter(&self) -> AudioBufferIterator<'_, Self>

Notable traits for AudioBufferIterator<'a, BufferType>

impl<'a, BufferType: AudioBuffer> Iterator for AudioBufferIterator<'a, BufferType> type Item = AudioFrameReference<'a, BufferType>;
{ ... } }
Expand description

Represents an audio buffer. This decouples audio processing code from a certain representation of multi-channel sample buffers.

This crate provides implementations of this trait for VST & CPal style buffers, which have different internal representations.

Associated Types

The type of samples within this buffer. Currently restricted to num::Float numbers.

Required methods

The number of channels in this buffer

The number of samples in this buffer

Get a ref to an INPUT sample in this buffer

Get a mutable ref to an OUTPUT sample in this buffer

On some implementations this may yield a different value than .get.

Set an OUTPUT sample in this buffer

Provided methods

Create a read only iterator

Implementors