Add a channel count function to Buffer
This commit is contained in:
parent
54881dfa15
commit
e5bac1e220
1 changed files with 5 additions and 0 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Reference in a new issue