1
0
Fork 0

Add a channel count function to Buffer

This commit is contained in:
Robbert van der Helm 2022-03-06 01:21:00 +01:00
parent 54881dfa15
commit e5bac1e220

View file

@ -245,6 +245,11 @@ impl<'a> Buffer<'a> {
}
}
/// Return the numer of channels in this buffer.
pub fn channels(&self) -> usize {
self.output_slices.len()
}
/// Returns true if this buffer does not contain any samples.
pub fn is_empty(&self) -> bool {
self.output_slices.is_empty() || self.output_slices[0].is_empty()