conformal_component::audio

Function channels

Source
pub fn channels<B: Buffer>(buffer: &B) -> impl Iterator<Item = &[f32]>
Expand description

Returns an iterator for the channels of a buffer.

The items of this iterator will be slices of the samples of each channel. Each slice will be exactly Buffer::num_frames elements long.

ยงExamples

let buffer = BufferData::new_stereo([1.0, 2.0], [3.0, 4.0]);
assert!(channels(&buffer).eq([[1.0, 2.0], [3.0, 4.0]]));