Struct claxon::frame::Block
[−]
[src]
pub struct Block<Sample> { // some fields omitted }
A block of raw audio samples.
Methods
impl<Sample: Sample> Block<Sample>
[src]
fn empty() -> Block<Sample>
Returns a block with 0 channels and 0 samples.
fn time(&self) -> u64
Returns the sample number of the first sample in the block.
fn len(&self) -> u16
Returns the number of inter-channel samples in the block.
fn channels(&self) -> u8
Returns the number of channels in the block.
fn channel(&self, ch: u8) -> &[Sample]
fn sample(&self, ch: u8, sample: u16) -> Sample
Returns a sample in this block.
The value returned is for the zero-based ch
-th channel of the
inter-channel sample with index sample
in this block (so this is not
the global sample number).
Panics
Panics if ch >= channels()
or if sample >= len()
for the last
channel.
fn into_buffer(self) -> Vec<Sample>
Returns the underlying buffer that stores the samples in this block.
This allows the buffer to be reused to decode the next frame. The
capacity of the buffer may be bigger than len()
times channels()
.