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 fn process_block(
62 &mut self,
63 _input: &InputAudioSampleBuffer<'_>,
64 output: &mut OutputAudioSampleBuffer<'_>,
65 ) {
66 for channel in 0..output.channels() {
67 let samples = &mut output[channel];
68 let tone = &mut self.tones[channel];
69
70 for (sample, tone) in samples.iter_mut().zip(tone) {
71 *sample = tone as f32;
72 }
73 }
74 }Trait Implementations§
Source§impl Index<usize> for OutputAudioSampleBuffer<'_>
impl Index<usize> for OutputAudioSampleBuffer<'_>
Auto Trait Implementations§
impl<'a> Freeze for OutputAudioSampleBuffer<'a>
impl<'a> RefUnwindSafe for OutputAudioSampleBuffer<'a>
impl<'a> !Send for OutputAudioSampleBuffer<'a>
impl<'a> !Sync for OutputAudioSampleBuffer<'a>
impl<'a> Unpin for OutputAudioSampleBuffer<'a>
impl<'a> !UnwindSafe for OutputAudioSampleBuffer<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more