Carbon


ExtCommonChunk

Header: AIFF.h

struct ExtCommonChunk {
    ID ckID; 
    SInt32 ckSize; 
    SInt16 numChannels; 
    UInt32 numSampleFrames; 
    SInt16 sampleSize; 
    extended80 sampleRate; 
    ID compressionType; 
    char compressionName[1];
};
typedef ExtCommonChunk ExtCommonChunkPtr;

Field descriptions

ckID

The ID of this chunk. For an extended Common Chunk, this ID is 'COMM'.

ckSize

The size of the data portion of this chunk. For an extended Common Chunk, this size is 22 plus the number of bytes in the compressionName string.

numChannels

The number of audio channels contained in the sampled sound. A value of 1 indicates monophonic sound, a value of 2 indicates stereo sound, a value of 4 indicates four-channel sound, and so forth.

numSampleFrames

The number of sample frames in the Sound Data Chunk. This field contains the number of sample frames, not the number of bytes of data and not the number of sample points. For noncompressed sound data, the total number of sample points in the file is numChannels * numSampleFrames.

sampleSize

The number of bits in each sample point of noncompressed sound data. The sampleSize field can contain any integer from 1 to 32. For compressed sound data, this field indicates the number of bits per sample in the original sound data, before compression.

sampleRate

The sample rate at which the sound is to be played back, in sample frames per second.

compressionType

The ID of the compression algorithm, if any, used on the sound data. Compression algorithms are supplied by Apple or you can define your own compression types, but you should register them with Apple. See “Compression Type Constants”.

compressionName

A human-readable name for the compression algorithm ID specified in the compressionType field. If the number of bytes in this field is odd, then it is padded with the digit 0. Compression algorithms are supplied by Apple or you can define your own compression types, but you should register them with Apple. See “Compression Algorithm Constants” and “Compression Type Constants”.

An AIFF-C file contains an extended Common Chunk that includes all of the fields of the Common Chunk, but adds two fields that describe the type of compression (if any) used on the audio data. The ExtCommonChunk data type defines an extended Common Chunk.

You should use this data structure only if you need to access this information or to customize sound play.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)