#ifndef __AIFF_SUPPORT_H__
#define __AIFF_SUPPORT_H__
#ifdef KERNEL
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include <libkern/OSByteOrder.h>
#pragma pack(push,2)
enum
{
kMono = 1,
kStereo = 2
};
enum
{
k8BitsPerSample = 8,
k16BitsPerSample = 16,
k16BitLittleEndianFormat = 0x736F7774 };
enum
{
kAIFCVersion1 = 0xA2805140
};
enum
{
kAIFFID = 0x41494646, kAIFCID = 0x41494643, kFormatVersionID = 0x46564552, kCommonID = 0x434F4D4D, kFormID = 0x464F524D, kSoundDataID = 0x53534E44 };
struct Float80 {
int16_t exp; uint16_t man[4]; };
typedef struct Float80 Float80;
struct ChunkHeader {
uint32_t ckID;
int32_t ckSize;
};
typedef struct ChunkHeader ChunkHeader;
struct ContainerChunk {
uint32_t ckID;
int32_t ckSize;
uint32_t formType;
};
typedef struct ContainerChunk ContainerChunk;
struct FormatVersionChunk {
uint32_t ckID;
int32_t ckSize;
uint32_t timeStamp;
};
typedef struct FormatVersionChunk FormatVersionChunk;
struct ExtCommonChunk {
uint32_t ckID;
int32_t ckSize;
int16_t numChannels;
uint32_t numSampleFrames;
int16_t sampleSize;
Float80 sampleRate;
uint32_t compressionType;
char compressionName[1]; };
typedef struct ExtCommonChunk ExtCommonChunk;
struct SoundDataChunk {
uint32_t ckID;
int32_t ckSize;
uint32_t offset;
uint32_t blockSize;
};
typedef struct SoundDataChunk SoundDataChunk;
struct CDAIFFHeader {
ContainerChunk containerChunk;
FormatVersionChunk formatVersionChunk;
ExtCommonChunk commonChunk;
SoundDataChunk soundDataChunk;
};
typedef struct CDAIFFHeader CDAIFFHeader;
void
BuildCDAIFFHeader ( CDAIFFHeader * header, uint32_t fileSize );
#pragma pack(pop)
#ifdef __cplusplus
}
#endif
#endif
#endif // __AIFF_SUPPORT_H__