AudioFormat

Enum AudioFormat 

Source
pub enum AudioFormat {
Show 36 variants LinearPCM(LinearPcmFlags), AC3, F60958AC3(StandardFlags), AppleIMA4, MPEG4AAC(Mpeg4ObjectId), MPEG4CELP(Mpeg4ObjectId), MPEG4HVXC(Mpeg4ObjectId), MPEG4TwinVQ(Mpeg4ObjectId), MACE3, MACE6, ULaw, ALaw, QDesign, QDesign2, QUALCOMM, MPEGLayer1, MPEGLayer2, MPEGLayer3, TimeCode(AudioTimeStampFlags), MIDIStream, ParameterValueStream, AppleLossless(AppleLosslessFlags), MPEG4AAC_HE, MPEG4AAC_LD, MPEG4AAC_ELD, MPEG4AAC_ELD_SBR, MPEG4AAC_ELD_V2, MPEG4AAC_HE_V2, MPEG4AAC_Spatial, AMR, AMR_WB, Audible, iLBC, DVIIntelIMA, MicrosoftGSM, AES3,
}
Expand description

A type-safe representation of both the AudioFormatId and their associated flags.

Variants§

§

LinearPCM(LinearPcmFlags)

Linear PCM; a non-compressed audio data format with one frame per packet.

Available in OS X v10.0 and later.

§

AC3

An AC-3 codec.

Available in OS X v10.2 and later.

§

F60958AC3(StandardFlags)

AC-3 codec that provides data packaged for transport over an IEC 60958 compliant digital audio interface.

Available in OS X v10.2 and later.

§

AppleIMA4

Apple’s implementation of the IMA 4:1 ADPCM codec.

Available in OS X v10.2 and later.

§

MPEG4AAC(Mpeg4ObjectId)

MPEG-4 AAC codec.

Available in OS X v10.2 and later.

§

MPEG4CELP(Mpeg4ObjectId)

MPEG-4 CELP codec.

Available in OS X v10.2 and later.

§

MPEG4HVXC(Mpeg4ObjectId)

MPEG-4 HVXC codec.

Available in OS X v10.2 and later.

§

MPEG4TwinVQ(Mpeg4ObjectId)

MPEG-4 TwinVQ codec.

Available in OS X v10.2 and later.

§

MACE3

MACE 3:1.

Available in OS X v10.3 and later.

§

MACE6

MACE 6:1.

Available in OS X v10.3 and later.

§

ULaw

μLaw 2:1.

Available in OS X v10.3 and later.

§

ALaw

aLaw 2:1.

Available in OS X v10.3 and later.

§

QDesign

QDesign Music.

Available in OS X v10.3 and later.

§

QDesign2

QDesign2 Music.

Available in OS X v10.3 and later.

§

QUALCOMM

QUALCOMM PureVoice.

Available in OS X v10.3 and later.

§

MPEGLayer1

MPEG-1/2, Layer 1 audio.

Available in OS X v10.3 and later.

§

MPEGLayer2

MPEG-1/2, Layer 2 audio.

Available in OS X v10.3 and later.

§

MPEGLayer3

MPEG-1/2, Layer 3 audio.

Available in OS X v10.3 and later.

§

TimeCode(AudioTimeStampFlags)

A stream of IOAudioTimeStamp structures.

Available in OS X v10.2 and later.

§

MIDIStream

A stream of MIDIPacketList structures where the time stamps in the MIDIPacket structures are sample offsets in the stream. The sample_rate field in the StreamFormat structure is used to describe how time is passed in this kind of stream.

An audio unit that receives or generates this stream can use this sample rate together with the number of frames it is rendering.

The sample offsets within the MIDIPacketList can be used to define the time for any MIDI event within the list.

Available in OS X v10.2 and later.

TODO: Review whether or not this audio format should indicate some fundamental change within the StreamFormat.

§

ParameterValueStream

A “side-chain” of f32 data that can be fed or generated by an audio unit and that is used to send a high density of parameter value control information.

An audio unit typically runs a parameter value stream at either the sample rate of the audio unit’s audio data, or some integer quotient of this (i.e. a half or a third of the sample rate of the audio).

The sample_rate field in the StreamFormat type describes this relationship.

Available in OS X v10.2 and later.

§

AppleLossless(AppleLosslessFlags)

Apple Lossless format.

Available in OS X v10.3 and later.

§

MPEG4AAC_HE

MPEG-4 High Efficiency AAC audio object.

Available in OS X v10.5 and later.

§

MPEG4AAC_LD

MPEG-4 AAC Low Delay audio object.

Available in OS X v10.5 and later.

§

MPEG4AAC_ELD

MPEG-4 AAC Enhanced Low Delay audio object.

Available in OS X v10.7 and later.

§

MPEG4AAC_ELD_SBR

MPEG-4 AAC Enhanced Low Delay audio object with SBR (spectral band replication) extension layer.

Available in OS X v10.7 and later.

§

MPEG4AAC_ELD_V2

§

MPEG4AAC_HE_V2

MPEG-4 High Efficiency AAC Version 2 audio object.

Available in OS X v10.5 and later.

§

MPEG4AAC_Spatial

MPEG-4 Apatial Audio audio object.

Available in OS X v10.5 and later.

§

AMR

The AMR (adaptive Multi-Rate) narrow band speech codec.

Available in OS X v10.5 and later.

§

AMR_WB

§

Audible

The codec used for Audible, Inc. audio books.

Available in OS X v10.6 and later.

§

iLBC

The iLBC (internet Low Bitrate Codec) narrow band cpeech codec.

Available in OS X v10.6 and later.

§

DVIIntelIMA

DVI/Intel IMA ADPCM - ACM code 17.

Available in OS X v10.6 and later.

§

MicrosoftGSM

Microsoft GSM 6.10 - ACM code 49.

Available in OS X v10.6 and later.

§

AES3

The format defined by the AES3-2003 standard.

Adopted into MXF and MPEG-2 containers and SDTI transport streams with SMPTE specs 203M-2002 and 331M-2000.

Implementations§

Source§

impl AudioFormat

Source

pub fn from_format_and_flag( format: c_uint, flag: Option<u32>, ) -> Option<AudioFormat>

Convert from the FFI C format and flags to a typesafe Rust enum representation.

Source

pub fn as_format_and_flag(&self) -> (c_uint, Option<u32>)

Convert from the Rust enum to the C format and flag.

Trait Implementations§

Source§

impl Clone for AudioFormat

Source§

fn clone(&self) -> AudioFormat

Returns a duplicate 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 AudioFormat

Source§

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

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

impl Copy for AudioFormat

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.
Source§

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