pub struct Block { /* private fields */ }Expand description
Contains one or more channels of 4 ms of audio data.
The audio is split into one or more frequency bands, each with a sampling
rate of 16 kHz. Each band/channel combination holds BLOCK_SIZE (64)
samples.
Implementations§
Source§impl Block
impl Block
pub fn new(num_bands: usize, num_channels: usize) -> Self
pub fn new_with_value(num_bands: usize, num_channels: usize, value: f32) -> Self
pub fn num_bands(&self) -> usize
pub fn num_channels(&self) -> usize
Sourcepub fn set_num_channels(&mut self, num_channels: usize)
pub fn set_num_channels(&mut self, num_channels: usize)
Modifies the number of channels and zeros all samples.
Sourcepub fn view(&self, band: usize, channel: usize) -> &[f32]
pub fn view(&self, band: usize, channel: usize) -> &[f32]
Returns a slice of BLOCK_SIZE samples for the given band and channel.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Block
impl RefUnwindSafe for Block
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl UnwindSafe for Block
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