一直在努力
分类:
2010-09-14 10:51:39
struct AudioStreamBasicDescription { Float64 mSampleRate; //每秒播放的fram数目; UInt32 mFormatID; //audio file 数据标志非零 UInt32 mFormatFlags;// UInt32 mBytesPerPacket; //一个packet中的字节数目,如果时可变的packet则为0; UInt32 mFramesPerPacket; //packet中包含的frame数目,无压缩时为1,可变比特率时,一个达点儿的固定值例如在ACC中1024。 UInt32 mBytesPerFrame; // UInt32 mChannelsPerFrame; //frame中包含的channel数目 UInt32 mBitsPerChannel; //The number of bits for one audio sample. UInt32 mReserved; //保留 }; typedef struct AudioStreamBasicDescription AudioStreamBasicDescription;
struct AudioStreamPacketDescription {
SInt64 mStartOffset;
UInt32 mVariableFramesInPacket;
UInt32 mDataByteSize;
};
typedef struct AudioStreamPacketDescription AudioStreamPacketDescription;
Constants
Sample Type Constants
#define kAudioUnitSampleFractionBits 24
Audio Data Format Identifiers
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_HE_V2 = 'aacp',
kAudioFormatMPEG4AAC_Spatial = 'aacs',
kAudioFormatAMR = 'samr',
kAudioFormatAudible = 'AUDB',
kAudioFormatiLBC = 'ilbc',
kAudioFormatDVIIntelIMA = 0x6D730011,
kAudioFormatMicrosoftGSM = 0x6D730031,
kAudioFormatAES3 = 'aes3'
};
AudioStreamBasicDescription Flags
enum {
kAudioFormatFlagIsFloat = (1 << 0), // 0x1
kAudioFormatFlagIsBigEndian = (1 << 1), // 0x2
kAudioFormatFlagIsSignedInteger = (1 << 2), // 0x4
kAudioFormatFlagIsPacked = (1 << 3), // 0x8
kAudioFormatFlagIsAlignedHigh = (1 << 4), // 0x10
kAudioFormatFlagIsNonInterleaved = (1 << 5), // 0x20
kAudioFormatFlagIsNonMixable = (1 << 6), // 0x40
kAudioFormatFlagsAreAllClear = (1 << 31),
kLinearPCMFormatFlagIsFloat = kAudioFormatFlagIsFloat,
kLinearPCMFormatFlagIsBigEndian = kAudioFormatFlagIsBigEndian,
kLinearPCMFormatFlagIsSignedInteger = kAudioFormatFlagIsSignedInteger,
kLinearPCMFormatFlagIsPacked = kAudioFormatFlagIsPacked,
kLinearPCMFormatFlagIsAlignedHigh = kAudioFormatFlagIsAlignedHigh,
kLinearPCMFormatFlagIsNonInterleaved = kAudioFormatFlagIsNonInterleaved,
kLinearPCMFormatFlagIsNonMixable = kAudioFormatFlagIsNonMixable,
kLinearPCMFormatFlagsSampleFractionShift = 7,
kLinearPCMFormatFlagsSampleFractionMask =
(0x3F << kLinearPCMFormatFlagsSampleFractionShift),
kLinearPCMFormatFlagsAreAllClear = kAudioFormatFlagsAreAllClear,
kAppleLosslessFormatFlag_16BitSourceData = 1,
kAppleLosslessFormatFlag_20BitSourceData = 2,
kAppleLosslessFormatFlag_24BitSourceData = 3,
kAppleLosslessFormatFlag_32BitSourceData = 4
};
AudioStreamBasicDescription Flag Combinations Constants
enum {
#if TARGET_RT_BIG_ENDIAN
kAudioFormatFlagsNativeEndian = kAudioFormatFlagIsBigEndian,
#else
kAudioFormatFlagsNativeEndian = 0,
#endif
#if !CA_PREFER_FIXED_POINT
kAudioFormatFlagsCanonical = kAudioFormatFlagIsFloat |
kAudioFormatFlagsNativeEndian |
kAudioFormatFlagIsPacked,
kAudioFormatFlagsAudioUnitCanonical = kAudioFormatFlagIsFloat |
kAudioFormatFlagsNativeEndian |
kAudioFormatFlagIsPacked |
kAudioFormatFlagIsNonInterleaved,
#else
kAudioFormatFlagsCanonical = kAudioFormatFlagIsSignedInteger |
kAudioFormatFlagsNativeEndian |
kAudioFormatFlagIsPacked,
kAudioFormatFlagsAudioUnitCanonical = kAudioFormatFlagIsSignedInteger |
kAudioFormatFlagsNativeEndian |
kAudioFormatFlagIsPacked |
kAudioFormatFlagIsNonInterleaved |
(kAudioUnitSampleFractionBits <<
kLinearPCMFormatFlagsSampleFractionShift),
#endif
kAudioFormatFlagsNativeFloatPacked = kAudioFormatFlagIsFloat |
kAudioFormatFlagsNativeEndian |
kAudioFormatFlagIsPacked
};
AudioSampleType
The canonical audio data sample type for input and output.
typedef SInt16 AudioSampleType;
AudioUnitSampleType
The canonical audio data sample type for audio processing.
typedef SInt32 AudioUnitSampleType;
#define kAudioUnitSampleFractionBits 24
chinaunix网友2010-09-14 14:49:27
很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com