当使用 afconvert 进行 AAC 输出时,我发现 m4af 类别下格式变体的文档很少:
‘aac’、‘aace’、‘aacf’、‘aach’、‘aacl’、‘aacp’、‘alac’、‘paac’。
我猜大概是“aac”是基础,“alac”是无损格式,“aach”是 HE-AAC。其余的呢?有什么区别?
其他格式标签下的其他变体也同样如此。
答案1
我自己弄的。这些标签由 CoreAudio 框架定义,可以在 Xcode 的 Framework 头文件 CoreAudioTypes.h 中找到
我将在此引用 OS X 10.9 Mavericks 中的片段:
/*!
@enum Format IDs
@abstract The four char code IDs used to identify individual formats of audio data.
@constant kAudioFormatLinearPCM
Linear PCM, uses the standard flags.
@constant kAudioFormatAC3
AC-3, has no flags.
@constant kAudioFormat60958AC3
AC-3 packaged for transport over an IEC 60958 compliant digital audio
interface. Uses the standard flags.
@constant kAudioFormatAppleIMA4
Apples implementation of IMA 4:1 ADPCM, has no flags.
@constant kAudioFormatMPEG4AAC
MPEG-4 Low Complexity AAC audio object, has no flags.
@constant kAudioFormatMPEG4CELP
MPEG-4 CELP audio object, has no flags.
@constant kAudioFormatMPEG4HVXC
MPEG-4 HVXC audio object, has no flags.
@constant kAudioFormatMPEG4TwinVQ
MPEG-4 TwinVQ audio object type, has no flags.
@constant kAudioFormatMACE3
MACE 3:1, has no flags.
@constant kAudioFormatMACE6
MACE 6:1, has no flags.
@constant kAudioFormatULaw
µLaw 2:1, has no flags.
@constant kAudioFormatALaw
aLaw 2:1, has no flags.
@constant kAudioFormatQDesign
QDesign music, has no flags
@constant kAudioFormatQDesign2
QDesign2 music, has no flags
@constant kAudioFormatQUALCOMM
QUALCOMM PureVoice, has no flags
@constant kAudioFormatMPEGLayer1
MPEG-1/2, Layer 1 audio, has no flags
@constant kAudioFormatMPEGLayer2
MPEG-1/2, Layer 2 audio, has no flags
@constant kAudioFormatMPEGLayer3
MPEG-1/2, Layer 3 audio, has no flags
@constant kAudioFormatTimeCode
A stream of IOAudioTimeStamps, uses the IOAudioTimeStamp flags (see
IOKit/audio/IOAudioTypes.h).
@constant kAudioFormatMIDIStream
A stream of MIDIPacketLists where the time stamps in the MIDIPacketList are
sample offsets in the stream. The mSampleRate field is used to describe how
time is passed in this kind of stream and an AudioUnit that receives or
generates this stream can use this sample rate, the number of frames it is
rendering and the sample offsets within the MIDIPacketList to define the
time for any MIDI event within this list. It has no flags.
@constant kAudioFormatParameterValueStream
A "side-chain" of Float32 data that can be fed or generated by an AudioUnit
and is used to send a high density of parameter value control information.
An AU will typically run a ParameterValueStream at either the sample rate of
the AudioUnit's audio data, or some integer divisor of this (say a half or a
third of the sample rate of the audio). The Sample Rate of the ASBD
describes this relationship. It has no flags.
@constant kAudioFormatAppleLossless
Apple Lossless, the flags indicate the bit depth of the source material.
@constant kAudioFormatMPEG4AAC_HE
MPEG-4 High Efficiency AAC audio object, has no flags.
@constant kAudioFormatMPEG4AAC_LD
MPEG-4 AAC Low Delay audio object, has no flags.
@constant kAudioFormatMPEG4AAC_ELD
MPEG-4 AAC Enhanced Low Delay audio object, has no flags. This is the formatID of
the base layer without the SBR extension. See also kAudioFormatMPEG4AAC_ELD_SBR
@constant kAudioFormatMPEG4AAC_ELD_SBR
MPEG-4 AAC Enhanced Low Delay audio object with SBR extension layer, has no flags.
@constant kAudioFormatMPEG4AAC_HE_V2
MPEG-4 High Efficiency AAC Version 2 audio object, has no flags.
@constant kAudioFormatMPEG4AAC_Spatial
MPEG-4 Spatial Audio audio object, has no flags.
@constant kAudioFormatAMR
The AMR Narrow Band speech codec.
@constant kAudioFormatAudible
The format used for Audible audio books. It has no flags.
@constant kAudioFormatiLBC
The iLBC narrow band speech codec. It has no flags.
@constant kAudioFormatDVIIntelIMA
DVI/Intel IMA ADPCM - ACM code 17.
@constant kAudioFormatMicrosoftGSM
Microsoft GSM 6.10 - ACM code 49.
@constant kAudioFormatAES3
This format is defined by AES3-2003, and adopted into MXF and MPEG-2
containers and SDTI transport streams with SMPTE specs 302M-2002 and
331M-2000. It has no flags.
*/
enum
{
kAudioFormatLinearPCM = 'lpcm',
kAudioFormatAC3 = 'ac-3',
kAudioFormat60958AC3 = 'cac3',
kAudioFormatAppleIMA4 = 'ima4',
kAudioFormatMPEG4AAC = 'aac ',
kAudioFormatMPEG4CELP = 'celp',
kAudioFormatMPEG4HVXC = 'hvxc',
kAudioFormatMPEG4TwinVQ = 'twvq',
kAudioFormatMACE3 = 'MAC3',
kAudioFormatMACE6 = 'MAC6',
kAudioFormatULaw = 'ulaw',
kAudioFormatALaw = 'alaw',
kAudioFormatQDesign = 'QDMC',
kAudioFormatQDesign2 = 'QDM2',
kAudioFormatQUALCOMM = 'Qclp',
kAudioFormatMPEGLayer1 = '.mp1',
kAudioFormatMPEGLayer2 = '.mp2',
kAudioFormatMPEGLayer3 = '.mp3',
kAudioFormatTimeCode = 'time',
kAudioFormatMIDIStream = 'midi',
kAudioFormatParameterValueStream = 'apvs',
kAudioFormatAppleLossless = 'alac',
kAudioFormatMPEG4AAC_HE = 'aach',
kAudioFormatMPEG4AAC_LD = 'aacl',
kAudioFormatMPEG4AAC_ELD = 'aace',
kAudioFormatMPEG4AAC_ELD_SBR = 'aacf',
kAudioFormatMPEG4AAC_ELD_V2 = 'aacg',
kAudioFormatMPEG4AAC_HE_V2 = 'aacp',
kAudioFormatMPEG4AAC_Spatial = 'aacs',
kAudioFormatAMR = 'samr',
kAudioFormatAudible = 'AUDB',
kAudioFormatiLBC = 'ilbc',
kAudioFormatDVIIntelIMA = 0x6D730011,
kAudioFormatMicrosoftGSM = 0x6D730031,
kAudioFormatAES3 = 'aes3'
};