pub enum Ac3AudioCodingMode {
DualMono,
Mono,
Stereo,
ThreeZero,
TwoOne,
ThreeOne,
TwoTwo,
ThreeTwo,
}Expand description
Audio coding mode carried in the 3-bit acmod field.
The enum names the speaker layout in the spec’s front/surround
notation; Self::channel_count returns nfchans (the count of
full-bandwidth channels, excluding the optional LFE channel).
Variants§
DualMono
000 — 1+1 (two independent mono channels, Ch1 + Ch2).
Mono
001 — 1/0 (centre only).
Stereo
010 — 2/0 (left + right stereo).
ThreeZero
011 — 3/0 (left, centre, right).
TwoOne
100 — 2/1 (left, right, mono surround).
ThreeOne
101 — 3/1 (left, centre, right, mono surround).
TwoTwo
110 — 2/2 (left, right, left-surround, right-surround).
ThreeTwo
111 — 3/2 (left, centre, right, left-surround,
right-surround).
Implementations§
Source§impl Ac3AudioCodingMode
impl Ac3AudioCodingMode
Sourcepub fn channel_count(self) -> u8
pub fn channel_count(self) -> u8
nfchans — the number of full-bandwidth channels, excluding
any LFE. (Add 1 to this for the total channel count when
Ac3Header::lfe_on is true.)
Sourcepub fn has_center_mix_level(self) -> bool
pub fn has_center_mix_level(self) -> bool
true for the three modes (3/0, 3/1, 3/2) that carry a
centre channel and therefore a cmixlev field — per the
(acmod & 0x1) && (acmod != 0x1) rule in the BSI layout.
Sourcepub fn has_surround_mix_level(self) -> bool
pub fn has_surround_mix_level(self) -> bool
true for the four modes (2/1, 3/1, 2/2, 3/2) that
carry a surround channel and therefore a surmixlev field —
per the acmod & 0x4 rule in the BSI layout.
Sourcepub fn has_dolby_surround_mode(self) -> bool
pub fn has_dolby_surround_mode(self) -> bool
true only for the 2/0 stereo mode, which carries the
dsurmod Dolby Surround flag — per the acmod == 0x2 rule.
Trait Implementations§
Source§impl Clone for Ac3AudioCodingMode
impl Clone for Ac3AudioCodingMode
Source§fn clone(&self) -> Ac3AudioCodingMode
fn clone(&self) -> Ac3AudioCodingMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for Ac3AudioCodingMode
Source§impl Debug for Ac3AudioCodingMode
impl Debug for Ac3AudioCodingMode
impl Eq for Ac3AudioCodingMode
Source§impl PartialEq for Ac3AudioCodingMode
impl PartialEq for Ac3AudioCodingMode
Source§fn eq(&self, other: &Ac3AudioCodingMode) -> bool
fn eq(&self, other: &Ac3AudioCodingMode) -> bool
self and other values to be equal, and is used by ==.