pub struct AudioFrame {
pub samples: Vec<f32>,
pub sample_rate: u32,
pub channels: u8,
pub pts: i64,
}Expand description
One decoded audio frame.
samples is interleaved planar — for stereo the layout is
[L0, R0, L1, R1, ...], length frames * channels. Values are
f32 in [-1.0, 1.0]. The encoder side accepts the same layout.
Fields§
§samples: Vec<f32>Interleaved planar samples (LRLRLR for stereo) in [-1.0, 1.0].
sample_rate: u32§channels: u8§pts: i64Presentation timestamp, microseconds, signed (allows negative pre-roll positions for codecs that emit lookahead frames before PTS=0 — Opus uses pre_skip rather than negative PTS, but this keeps the type general).
Trait Implementations§
Source§impl Clone for AudioFrame
impl Clone for AudioFrame
Source§fn clone(&self) -> AudioFrame
fn clone(&self) -> AudioFrame
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AudioFrame
impl RefUnwindSafe for AudioFrame
impl Send for AudioFrame
impl Sync for AudioFrame
impl Unpin for AudioFrame
impl UnsafeUnpin for AudioFrame
impl UnwindSafe for AudioFrame
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