An AIFF-C file is an IFF file. It is one FORM chunk holding further chunks,
and every number in its chunk headers and fields is big-endian.
Chunk
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 4 | ID | ckID | four printable ASCII characters, 0x20 to 0x7E; no leading spaces, trailing spaces allowed |
| 4 | 4 | s32 | ckSize | the number of data bytes, not counting this header or the pad byte |
| 8 | ckSize | bytes | ckData | the chunk’s data |
| … | 0 or 1 | byte | pad | a zero byte after data of odd length, not counted in ckSize |
FORM chunk
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 4 | ID | ckID | FORM |
| 4 | 4 | s32 | ckSize | the size of everything after this field, which is the file’s length minus 8 |
| 8 | 4 | ID | formType | AIFC |
| 12 | … | chunks | local chunks | the chunks below, in any order |
FVER chunk: format version
Every AIFF-C file has exactly one. Its size is 4.
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 4 | u32 | timestamp | the date of the format version, in seconds since 1 January 1904; not the date of the file |
The only value defined is AIFCVersion1, 0xA2805140: 23 May
1990, 2:40 p.m. Only Apple could change it. libsndfile warns when a file lacks this
chunk, but still reads the file.
Chunks in a FORM AIFC
| ID | Chunk | Number | Page |
|---|---|---|---|
FVER | format version | exactly one | above |
COMM | common | exactly one | Common chunk |
SSND | sound data | at most one; required unless there are no sample frames | Sound data |
MARK | marker | at most one | Metadata chunks |
COMT | comments | at most one | Metadata chunks |
INST | instrument | at most one | Metadata chunks |
MIDI | MIDI data | any number | Metadata chunks |
AESD | audio recording | at most one | Metadata chunks |
APPL | application specific | any number | Metadata chunks |
SAXL | sound accelerator | any number (in the draft only) | Metadata chunks |
NAME, AUTH, (c) | name, author, copyright | at most one of each | Metadata chunks |
ANNO | annotation | any number | Metadata chunks |
Chunks may come in any order, so a reader finds them by ID, not position. Audio is usually last. A program that changes the audio must update chunks derived from it, and should drop chunks it does not understand.
Chunk precedence
The AIFF-C draft settles conflicts between chunks by this order, highest first: FVER, COMM, INST,
SAXL, COMT, MARK, SSND, NAME, AUTH, (c) ,
ANNO, AESD, MIDI, APPL. Several chunks of one kind rank in the order they appear.
(AIFF 1.3 ranks SSND and MARK above INST; the draft moved INST up.)
A program that writes into a lower chunk must update the higher ones.
File types, extension and the old AIFS form
- The file is one FORM AIFC in the data fork; keep nothing in the resource fork. Macintosh file type
AIFC; Apple II (ProDOS) file type 0xD8, aux type 0x0000. The recommended extension is.AFC; in practice.aifc,.aifand.aiffare all used, and the form type, not the name, tells the formats apart. - Apple asks that readers of FORM AIFF also read FORM AIFC, and that writers offer AIFC as the default.
- A draft of AIFF-C written before the Format Version chunk existed used the form type
AIFS(the file “JLG MacWorld” on a May 1990 developer CD). It is not valid AIFF-C and readers must not accept it; the explorer’s test turnsFORM AIFSdown. - A reader that does not find a chunk it needs should look at
FVER: an unrecognised version means a newer format, noFVERor a recognised one means the file is damaged. Compare versions for equality, not order.
Example
A mono file of 1,000 frames of 16-bit uncompressed audio at 44,100 Hz.
| Offset | Bytes | Meaning |
|---|---|---|
| 0 | 46 4F 52 4D | FORM |
| 4 | 00 00 08 1E | size 2,078 |
| 8 | 41 49 46 43 | AIFC |
| 12 | 46 56 45 52 | FVER |
| 16 | 00 00 00 04 | size 4 |
| 20 | A2 80 51 40 | AIFCVersion1 |
| 24 | 43 4F 4D 4D | COMM |
| 28 | 00 00 00 26 | size 38 |
| 32 | 00 01 | 1 channel |
| 34 | 00 00 03 E8 | 1,000 frames |
| 38 | 00 10 | 16 bits |
| 40 | 40 0E AC 44 00 00 00 00 00 00 | 44,100 Hz |
| 50 | 4E 4F 4E 45 | compression type NONE |
| 54 | 0E 6E 6F 74 20 63 6F 6D 70 72 65 73 73 65 64 00 | name: not compressed, with a pad byte |
| 70 | 53 53 4E 44 | SSND |
| 74 | 00 00 07 D8 | size 2,008 |
| 78 | 00 00 00 00 | offset 0 |
| 82 | 00 00 00 00 | block size 0 |
| 86 | 2,000 bytes | samples |
Source: Apple, Audio Interchange File Format AIFF-C draft (1991), section 3.0 Format Version Chunk (page 5: AIFCVersion1 0xA2805140 = 2726318400, ckDataSize 4, compare for equality), File Structure (the .AFC extension, Apple II file type 0xD8), Chunk Precedence (page 27) and Appendix A. The date of AIFCVersion1 (1990-05-23 14:40:00, counting from 1 January 1904) is also computed in McGill MMSP’s notes (AIFF.html). The AIFS form comes from the file named above, not from the specification.