pub struct OutputAudioSampleBuffer<'a> { /* private fields */ }Expand description
A multi-channel buffer of read-write audio samples.
Implementations§
source§impl<'a> OutputAudioSampleBuffer<'a>
impl<'a> OutputAudioSampleBuffer<'a>
sourcepub fn channels(&self) -> usize
pub fn channels(&self) -> usize
Returns the numbers of channels in the buffer.
Examples found in repository?
examples/audio_callback.rs (line 66)
61 62 63 64 65 66 67 68 69 70 71 72 73 74
fn process_block(
&mut self,
_input: &InputAudioSampleBuffer<'_>,
output: &mut OutputAudioSampleBuffer<'_>,
) {
for channel in 0..output.channels() {
let samples = &mut output[channel];
let tone = &mut self.tones[channel];
for (sample, tone) in samples.iter_mut().zip(tone) {
*sample = tone as f32;
}
}
}