pub struct AudioBlock {
pub start_sample: i64,
pub sample_rate: u32,
pub speakers: SpeakerLayout,
pub channels: Vec<Vec<f32>>,
}Expand description
Planar floating-point audio at the project sample rate.
Positions are sample indices, never ticks, because a tick is not a whole number of samples
at 44.1 kHz. Sample n is at n / sample_rate seconds on the block’s timeline (the
source’s for a decoder, the project’s for a mixer).
Decoder and AudioBlockProvider blocks keep the source’s channels and speakers; the mixer
folds them into the project layout.
Fields§
§start_sample: i64Index of the first sample, at sample_rate.
sample_rate: u32Project sample rate used by every returned block.
speakers: SpeakerLayoutThe speaker each of channels feeds, one per plane.
channels: Vec<Vec<f32>>One vector per channel, all with equal lengths, in speakers’ order.
Implementations§
Source§impl AudioBlock
impl AudioBlock
Sourcepub fn end_sample(&self) -> i64
pub fn end_sample(&self) -> i64
Index one past the last sample.
Sourcepub fn start_time(&self) -> MediaTime
pub fn start_time(&self) -> MediaTime
The first sample’s time, rounded down to the tick grid. Audio positions stay in samples.
Trait Implementations§
Source§impl Clone for AudioBlock
impl Clone for AudioBlock
Source§impl Debug for AudioBlock
impl Debug for AudioBlock
Source§impl PartialEq for AudioBlock
impl PartialEq for AudioBlock
impl StructuralPartialEq for AudioBlock
Auto Trait Implementations§
impl Freeze for AudioBlock
impl RefUnwindSafe for AudioBlock
impl Send for AudioBlock
impl Sync for AudioBlock
impl Unpin for AudioBlock
impl UnsafeUnpin for AudioBlock
impl UnwindSafe for AudioBlock
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