Trait rsynth::backend::combined::AudioWriter[][src]

pub trait AudioWriter<S> where
    S: Copy
{ type Err; fn write_buffer(
        &mut self,
        buffer: &AudioBufferIn<'_, '_, S>
    ) -> Result<(), Self::Err>; fn specifies_number_of_channels(&self) -> bool { ... }
fn number_of_channels(&self) -> usize { ... } }

Define how audio is written.

This trait is generic over S, which represents the data-type used for a sample.

Associated Types

type Err[src]

The type of the error that occurs when reading data.

Loading content...

Required methods

fn write_buffer(
    &mut self,
    buffer: &AudioBufferIn<'_, '_, S>
) -> Result<(), Self::Err>
[src]

Write to the specified audio buffer.

If specifies_number_of_channels() returns false, the number of audio channels is determined by the first call to this method. If specifies_number_of_channels() returns true, the number of audio channels is determined by the number_of_channels() method.

Panics

Implementations of this method may panic if the number of audio channels is not as expected.

Loading content...

Provided methods

fn specifies_number_of_channels(&self) -> bool[src]

Return true if this AudioWriter is responsible for specifying the number of channels and false if this is determined by the first call to write_buffer.

Note: this method will disappear in a future version of rsynth and it will be the default that the AudioWriter specifies the number of channels. This method has a default implementation that returns false.

fn number_of_channels(&self) -> usize[src]

Return the number of channels. This method is only called if specifies_number_of_channels returns true. This method should always return the same number.

Note: this method has a default implementation that returns 0. This default implementation will disappear in a future version of rsynth and then implementors have to specify the number of channels.

Loading content...

Implementors

impl<'b, S> AudioWriter<S> for AudioBufferWriter<'b, S> where
    S: Copy
[src]

type Err = Infallible

impl<'w, T, S> AudioWriter<S> for TestAudioWriter<'w, T, S> where
    T: AudioWriter<S>,
    S: Debug + PartialEq + Copy
[src]

type Err = <T as AudioWriter<S>>::Err

impl<'ww, S> AudioWriter<S> for HoundAudioWriter<'ww, S> where
    S: ToSample<f32> + ToSample<i32> + ToSample<i16> + Copy
[src]

type Err = Error

impl<S> AudioWriter<S> for AudioDummy<S> where
    S: Copy
[src]

type Err = Infallible

Loading content...