The COMM chunk describes the audio. Every file has exactly one. The size is
22 plus the length of the compression name’s bytes, the count byte and any pad byte
included.
Fields
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | s16 | numChannels | the number of channels: 1 is mono, 2 stereo, 4 four-channel and so on |
| 2 | 4 | u32 | numSampleFrames | the number of sample frames, not bytes or sample points |
| 6 | 2 | s16 | sampleSize | the bits per sample point, 1 to 32; for compressed data, the depth of the audio before compression |
| 8 | 10 | extended | sampleRate | the sample frames per second, as an 80-bit float |
| 18 | 4 | ID | compressionType | a four-character code naming the compression; see Compression types |
| 22 | varies | pstring | compressionName | a name for people to read, such as not compressed |
The name is a Pascal string, a count byte and then the text. The whole string, count byte included, must be an even number of bytes, so when the text’s length is even (the count byte and the text together are odd) a 0 byte follows, not counted in the count. Custom compression types were to be registered with Apple. The name is meant for displaying in alert boxes, and software does not depend on it.
The 80-bit sample rate
The rate is an IEEE 754 extended-precision float: a sign bit and 15-bit exponent, big-endian, then a 64-bit mantissa with an explicit leading 1.
| Offset | Size | Meaning |
|---|---|---|
| 0 | 2 | the sign in the top bit, and the exponent plus 16,383 |
| 2 | 8 | the mantissa |
Value = mantissa ÷ 263 × 2exponent − 16383.
| Rate | Bytes |
|---|---|
| 8,000 Hz | 40 0B FA 00 00 00 00 00 00 00 |
| 22,050 Hz | 40 0D AC 44 00 00 00 00 00 00 |
| 44,100 Hz | 40 0E AC 44 00 00 00 00 00 00 |
| 48,000 Hz | 40 0E BB 80 00 00 00 00 00 00 |
Source: Apple, Audio Interchange File Format AIFF-C draft (draft date 8/26/91 on its first page; the page footers read 7/30/90), section 4.0 Common Chunk (page 9: ckDataSize is 22 plus the pstring, compressionType and compressionName, the pstring pad rule) and Appendix A (pages 29 to 31: the 22254.54 and 44100.00 examples). The 80-bit rate bytes were computed from the format and compared by script with the viewer’s reader.