pub struct AudioTrack {
pub codec: String,
pub samples: Vec<Vec<u8>>,
pub sample_rate: u32,
pub channels: u16,
pub asc: Vec<u8>,
pub codec_private: Vec<u8>,
pub timescale: u32,
pub durations: Vec<u32>,
}Expand description
Audio track extracted for passthrough or transcode. Supports two codec families today (Squad-18 + Squad-23):
- AAC-LC:
codec = "aac",ascholds the verbatim AudioSpecificConfig bytes sourced from the MP4 esds descriptor (not the mp4 crate’s rebuilt form) or MKVCodecPrivate, so HE-AAC / xHE-AAC signaling survives the copy.codec_privateis empty. - Opus:
codec = "opus",codec_privateholds the RFC 7845 §5.1OpusHeadbody verbatim — for MKV/WebM that’s exactly theCodecPrivateelement bytes (post-magic — RFC 7845 §5.2 specifies no magic prefix for the MKV CodecPrivate); for MP4-Opus that’s thedOpsbody re-serialised in OpusHead’s LE numeric convention.ascis empty.
samples are codec-native packets (AAC: ADTS-stripped raw access
units; Opus: TOC-prefixed Opus packets, one per frame). durations
are per-sample in timescale units.
Fields§
§codec: String§samples: Vec<Vec<u8>>§sample_rate: u32§channels: u16§asc: Vec<u8>AAC-only: AudioSpecificConfig bytes. Empty for non-AAC codecs.
codec_private: Vec<u8>Opus-only: OpusHead body bytes (RFC 7845 §5.1). Empty for non-Opus codecs. The 8-byte ‘OpusHead’ magic prefix is NOT included — only the post-magic body.
timescale: u32§durations: Vec<u32>Trait Implementations§
Source§impl Clone for AudioTrack
impl Clone for AudioTrack
Source§fn clone(&self) -> AudioTrack
fn clone(&self) -> AudioTrack
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 AudioTrack
impl RefUnwindSafe for AudioTrack
impl Send for AudioTrack
impl Sync for AudioTrack
impl Unpin for AudioTrack
impl UnsafeUnpin for AudioTrack
impl UnwindSafe for AudioTrack
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