Trait rsynth::backend::combined::AudioWriter [−][src]
Define how audio is written.
This trait is generic over S
, which represents the data-type used for a sample.
Associated Types
Loading content...Required methods
fn write_buffer(
&mut self,
buffer: &AudioBufferIn<'_, '_, S>
) -> Result<(), Self::Err>
[src]
&mut self,
buffer: &AudioBufferIn<'_, '_, S>
) -> Result<(), Self::Err>
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.
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.
Implementors
impl<'b, S> AudioWriter<S> for AudioBufferWriter<'b, S> where
S: Copy,
[src]
S: Copy,
type Err = Infallible
fn write_buffer(
&mut self,
buffer: &AudioBufferIn<'_, '_, S>
) -> Result<(), Self::Err>
[src]
&mut self,
buffer: &AudioBufferIn<'_, '_, S>
) -> Result<(), Self::Err>
fn specifies_number_of_channels(&self) -> bool
[src]
fn number_of_channels(&self) -> usize
[src]
impl<'w, T, S> AudioWriter<S> for TestAudioWriter<'w, T, S> where
T: AudioWriter<S>,
S: Debug + PartialEq + Copy,
[src]
T: AudioWriter<S>,
S: Debug + PartialEq + Copy,
type Err = <T as AudioWriter<S>>::Err
fn write_buffer(
&mut self,
chunk: &AudioBufferIn<'_, '_, S>
) -> Result<(), Self::Err>
[src]
&mut self,
chunk: &AudioBufferIn<'_, '_, S>
) -> Result<(), Self::Err>
impl<'ww, S> AudioWriter<S> for HoundAudioWriter<'ww, S> where
S: ToSample<f32> + ToSample<i32> + ToSample<i16> + Copy,
[src]
S: ToSample<f32> + ToSample<i32> + ToSample<i16> + Copy,
type Err = Error
fn write_buffer(
&mut self,
inputs: &AudioBufferIn<'_, '_, S>
) -> Result<(), Self::Err>
[src]
&mut self,
inputs: &AudioBufferIn<'_, '_, S>
) -> Result<(), Self::Err>
fn specifies_number_of_channels(&self) -> bool
[src]
fn number_of_channels(&self) -> usize
[src]
impl<S> AudioWriter<S> for AudioDummy<S> where
S: Copy,
[src]
S: Copy,
type Err = Infallible
fn write_buffer(
&mut self,
_buffer: &AudioBufferIn<'_, '_, S>
) -> Result<(), Self::Err>
[src]
&mut self,
_buffer: &AudioBufferIn<'_, '_, S>
) -> Result<(), Self::Err>