Struct mpeg4_audio_const::AudioObjectType

source ·
pub struct AudioObjectType(/* private fields */);
Expand description

Represents an audio object type indicator value.

This type can be constructed from a u8,

assert_eq!(AudioObjectType::AAC_LC, AudioObjectType::try_from(2).unwrap());
assert_eq!(2u8, AudioObjectType::AAC_LC.into());

and will accept values that are ‘reserved’ in the spec,

assert_eq!("RESERVED(95)", format!("{:?}", AudioObjectType::try_from(95).unwrap()));

but disallows values that can’t legitimately be represented because they are too large (the maximum representable a-o-t value is 96) and also disallows the ‘escape value’ (value 31 see AOT_ESCAPE_VALUE) which is used as part of the encoding scheme for the a-o-t field rather than as a distinct field value.

assert_eq!(Err(AudioObjectTypeError::EscapeValue), AudioObjectType::try_from(31));
assert_eq!(Err(AudioObjectTypeError::TooLarge(97)), AudioObjectType::try_from(97));

Implementations§

source§

impl AudioObjectType

source

pub const NULL: AudioObjectType = _

Null

source

pub const AAC_MAIN: AudioObjectType = _

AAC main

source

pub const AAC_SSR: AudioObjectType = _

AAC SSR

source

pub const AAC_LTP: AudioObjectType = _

AAC LTP

source

pub const TWIN_VQ: AudioObjectType = _

TwinVQ

source

pub const CELP: AudioObjectType = _

CELP

source

pub const HVXC: AudioObjectType = _

HVXC

source

pub const SBR: AudioObjectType = _

SBR

source

pub const AAC_SCALABLE: AudioObjectType = _

AAC Scalable

source

pub const AAC_LC: AudioObjectType = _

AAC LC

source

pub const TTSI: AudioObjectType = _

TTSI

source

pub const MAIN_SYNTHETIC: AudioObjectType = _

Main synthetic

source

pub const WAVETABLE_SYNTHESIS: AudioObjectType = _

Wavetable synthesis

source

pub const GENERAL_MIDI: AudioObjectType = _

General MIDI

source

pub const ALGORITHMIC_SYNTHESIS_AND_AUDIO_FX: AudioObjectType = _

Algorithmic Synthesis and Audio FX

source

pub const ER_AAC_LC: AudioObjectType = _

ER AAC LC

source

pub const ER_AAC_LTP: AudioObjectType = _

ER AAC LTP

source

pub const ER_AAC_SCALABLE: AudioObjectType = _

ER AAC Scalable

source

pub const ER_TWIN_VQ: AudioObjectType = _

ER TwinVQ

source

pub const ER_BSAC: AudioObjectType = _

ER BSAC

source

pub const ER_AAC_LD: AudioObjectType = _

ER AAC LD

source

pub const ER_CELP: AudioObjectType = _

ER CELP

source

pub const ER_HVXC: AudioObjectType = _

ER HVXC

source

pub const ER_HILN: AudioObjectType = _

ER HILN

source

pub const ER_PARAMETRIC: AudioObjectType = _

ER Parametric

source

pub const SSC: AudioObjectType = _

SSC

source

pub const PS: AudioObjectType = _

PS

source

pub const MPEG_SURROUND: AudioObjectType = _

MPEG Surround

source

pub const LAYER1: AudioObjectType = _

Layer-1

source

pub const LAYER3: AudioObjectType = _

Layer-3

source

pub const DST: AudioObjectType = _

DST

source

pub const ALS: AudioObjectType = _

ALS

source

pub const SLS: AudioObjectType = _

SLS

source

pub const SLS_NON_CORE: AudioObjectType = _

SLS non-core

source

pub const ER_AAC_ELD: AudioObjectType = _

ER AAC ELD

source

pub const SMR_SIMPLE: AudioObjectType = _

SMR Simple

source

pub const SMR_MAIN: AudioObjectType = _

SMR Main

source

pub const USAC: AudioObjectType = _

Unified Speech and Audio Coding

source

pub const SAOC: AudioObjectType = _

Spatial Audio Object Coding

source

pub const LD_MPEG_SURROUND: AudioObjectType = _

Low Delay MPEG Surround

source

pub const SAOC_DE: AudioObjectType = _

Spatial Audio Object Coding Dialogue Enhancement

source

pub const AUDIO_SYNC: AudioObjectType = _

Audio synchronization tool

Trait Implementations§

source§

impl Clone for AudioObjectType

source§

fn clone(&self) -> AudioObjectType

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for AudioObjectType

source§

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

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

impl From<AudioObjectType> for u8

source§

fn from(v: AudioObjectType) -> Self

Converts to this type from the input type.
source§

impl PartialEq for AudioObjectType

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<u8> for AudioObjectType

§

type Error = AudioObjectTypeError

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

fn try_from(value: u8) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Copy for AudioObjectType

source§

impl Eq for AudioObjectType

source§

impl StructuralPartialEq for AudioObjectType

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> 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,

§

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>,

§

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>,

§

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.