// AudioStream — one DASH or progressive audio variant. use crate::stream::DeliveryMethod; use crate::youtube::itag::MediaFormat; /// The track type of an [`AudioStream`]. Mirrors NPE /// `stream/AudioTrackType.java`; derived from the format's `xtags` protobuf /// (`acont` key) — see `youtube::xtags`. #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)] pub enum AudioTrackType { /// The original audio track of a video. Original, /// The original voices replaced, typically in a different language. Dubbed, /// A descriptive (audio-description) track for accessibility. Descriptive, /// A secondary track (e.g. an alternate/commentary track). Secondary, } #[derive(Clone, Debug)] pub struct AudioStream { pub itag: u32, pub url: String, pub format: MediaFormat, pub delivery: DeliveryMethod, pub average_bitrate_kbps: Option, pub codec: Option, pub content_length_bytes: Option, pub audio_track_id: Option, pub audio_track_name: Option, pub audio_locale: Option, /// True iff this is a descriptive (audio-description) track. Preferentially /// derived from `xtags` (`acont == descriptive`); falls back to the legacy /// `audioTrack.audioIsDefault` heuristic when `xtags` is absent/unparseable. pub is_descriptive: bool, /// The authoritative audio track type from the format's `xtags` blob, or /// `None` for single-track audio / when `xtags` is absent or unparseable. pub track_type: Option, pub itag_url_format: Option, }