Skip to main content

Ac3AudioCodingMode

Enum Ac3AudioCodingMode 

Source
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

Source

pub fn code(self) -> u8

The raw 3-bit acmod code.

Source

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.)

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> Ac3AudioCodingMode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Ac3AudioCodingMode

Source§

impl Debug for Ac3AudioCodingMode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Ac3AudioCodingMode

Source§

impl PartialEq for Ac3AudioCodingMode

Source§

fn eq(&self, other: &Ac3AudioCodingMode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Ac3AudioCodingMode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.