These chunks are optional. A reader may ignore any of them. Offsets are from the start of a chunk’s data.
Pascal strings
A pstring is a byte giving the length, then that many characters. The
total must be even, so a pad byte follows when the count and the characters come to an
odd number; the count does not include the pad.
MARK: markers
Named positions in the sound data.
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | u16 | numMarkers | the number of markers |
| 2 | varies | record | markers | the markers, in no particular order |
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | s16 | id | a positive number, unique in the file; 0 is not allowed |
| 2 | 4 | u32 | position | the place in sample frames: markers fall between frames, so 0 is before the first and 1 is between the first and second |
| 6 | varies | pstring | markerName | the name |
COMT: comments
Comments, each with a time and optionally tied to a marker. Apple’s AIFF-C documents
suggest this chunk rather than ANNO for comments.
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | u16 | numComments | the number of comments |
| 2 | varies | record | comments | the comments |
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 4 | u32 | timeStamp | the time, in seconds since 1 January 1904 |
| 4 | 2 | s16 | marker | the ID of a linked marker, or 0 |
| 6 | 2 | u16 | count | the length of the text |
| 8 | count | bytes | text | the comment, with a pad byte if needed for even length |
INST: instrument
Playback settings for a sampler. The chunk’s size is always 20.
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 1 | s8 | baseNote | the MIDI note the sound plays unchanged at, 0 to 127; 60 is middle C |
| 1 | 1 | s8 | detune | the pitch offset in cents, −50 to 50 |
| 2 | 1 | s8 | lowNote | the lowest suggested note |
| 3 | 1 | s8 | highNote | the highest suggested note, inclusive |
| 4 | 1 | s8 | lowVelocity | the lowest suggested note-on velocity, 1 to 127 |
| 5 | 1 | s8 | highVelocity | the highest suggested note-on velocity, 1 to 127 |
| 6 | 2 | s16 | gain | the gain in decibels: 0 is unchanged and 6 doubles each sample point |
| 8 | 6 | record | sustainLoop | the loop played while a note is held |
| 14 | 6 | record | releaseLoop | the loop played in the release phase |
A loop:
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | s16 | playMode | 0 for no looping, 1 for forward, 2 for forward then backward |
| 2 | 2 | s16 | beginLoop | the marker that starts the loop |
| 4 | 2 | s16 | endLoop | the marker that ends it |
MIDI: MIDI data
A stream of MIDI data, mainly System Exclusive messages. A file may hold several of these chunks, preferably one per instrument.
AESD: audio recording
24 bytes, always (192 bits). The AES channel status data from the recording, copied from the AES
recommended practice for serial transmission, section 7.1. The AIFF specifications only say that bits 2, 3 and 4 of byte 0
give the recording emphasis; the layout of all 24 bytes is that of AES3 channel status, and bit 0 of byte 0 selects which
layout follows. The professional layout is defined in full by EBU Tech 3250 (the EBU’s free text of AES3, third edition, 2004);
the consumer layout is that of IEC 60958-3 (a paid standard), whose values are read here from the open source
asoundef.h of alsa-lib, which implements it. The explorer decodes every field of both layouts into words.
The AES standard itself, AES3-1992 (r1997) with its Amendments 1 to 4, is available as a free copy (McGill University’s course
files) and was read for this page; it agrees with EBU Tech 3250 on every table except the small differences noted below.
The current edition, AES3-2009 (parts 1 to 4), is not free and was not read.
Bit order. AES3 and EBU Tech 3250 print every field with its bit 0 first: bits 6 and 7 of byte 0 printed
“01” mean bit 6 clear and bit 7 set. The tables below give each value as printed and, in brackets, as the number the field makes in the
byte (bit 0 of the field is the least significant bit): 48 kHz is printed 01 and is the number 2, so the byte is 0x80 in
those bits. 0x85, the usual first byte, is professional, linear PCM, no emphasis, locked, 48 kHz.
| Byte | Professional layout (bit 0 of byte 0 is 1) |
|---|---|
| 0 | bit 0 professional (1); bit 1: 0 linear PCM audio, 1 other data; bits 2–4 emphasis: 000 (0) not indicated, receiver assumes none, 100 (1) none, 110 (3) 50/15 µs, 111 (7) CCITT J.17 (6.5 dB insertion loss at 500 Hz in Tech 3250, at 800 Hz in AES3-1992), other values reserved; bit 5: 0 source sampling frequency locked (AES3-1992: lock condition not indicated), 1 unlocked; bits 6–7 sampling frequency: 00 (0) not indicated, 01 (2) 48 kHz, 10 (1) 44.1 kHz, 11 (3) 32 kHz |
| 1 | bits 0–3 channel mode: 0000 (0) not indicated, receiver assumes two-channel; 0001 (8) two-channel; 0010 (4) single channel (monophonic); 0011 (12) primary/secondary (sub-frame 1 is primary); 0100 (2) stereophonic (channel 1 is left); 0101 (10) and 0110 (6) reserved for user-defined applications; 0111 (14) single channel double sampling frequency (both sub-frames carry successive samples of one signal; the rate is twice that in byte 0; vector to byte 3 for the channel number); 1000 (1) the same, stereo left; 1001 (9) the same, stereo right; 1111 (15) multichannel, vector to byte 3; all others reserved. Bits 4–7 user bits: 0000 (0) none indicated, 0001 (8) 192-bit block structure (the Z preamble starts a block), 0010 (4) packet system based on HDLC (EBU Tech 3250 Supplement 1; AES3-1992 calls this value reserved for the AES18 standard), 0011 (12) user defined, 0100 (2) the user data format of IEC 60958-3, 0101 (10) metadata; all others reserved |
| 2 | bits 0–2 use of the auxiliary sample bits: 000 (0) maximum word length 20 bits, aux bits not defined (default); 001 (4) maximum 24 bits, the aux bits carry main audio; 010 (2) maximum 20 bits, the aux bits carry a single coordination signal; 011 (6) user defined; others reserved. Bits 3–5 source word length: with a 24-bit maximum 000 (0) not indicated, 001 (4) 23 bits, 010 (2) 22, 011 (6) 21, 100 (1) 20, 101 (5) 24; with a 20-bit maximum 001 (4) 19, 010 (2) 18, 011 (6) 17, 100 (1) 16, 101 (5) 20. Bits 6–7 alignment level: 00 (0) not indicated, 01 (2) SMPTE RP155 (20 dB below maximum code), 10 (1) EBU R68 (18.06 dB below maximum code), 11 reserved |
| 3 | bit 7 clear (default): bits 0–6 are the channel number minus one (value + 1). Bit 7 set: bits 4–6 are the multichannel mode, 000 (0) mode 0, 100 (1) mode 1, 010 (2) mode 2, 110 (3) mode 3, 111 (7) user-defined (the standard mappings of channels to functions are not published in Tech 3250), and bits 0–3 the channel number minus one; that 4-bit number maps to bits 20–23 of the consumer layout (consumer channel A is channel 2, B is 3, and so on) |
| 4 | bits 0–1 digital audio reference signal (AES11): 00 not a reference (default), 01 (2) grade 1, 10 (1) grade 2, 11 reserved; bit 2 reserved; bits 3–6 sampling frequency, printed bit 3 first: 0000 (0) not indicated, 1000 (1) 24 kHz, 0100 (2) 96 kHz, 1100 (3) 192 kHz, 0001 (8) reserved for vectoring, 1001 (9) 22.05 kHz, 0101 (10) 88.2 kHz, 1101 (11) 176.4 kHz, 1111 (15) user defined, the rest reserved; bit 7 sampling frequency scaling: 1 means 1/1.001 times the rate indicated here or in byte 0 (the NTSC-related rates) |
| 5 | reserved, zero |
| 6–9 | channel origin: 7-bit ISO 646 (ASCII) characters, the first in byte 6; the control codes 01 to 1F and 7F are not allowed; default 00 |
| 10–13 | channel destination, in the same form |
| 14–17 | local sample address code: a 32-bit binary number, least significant byte first, the number of the first sample of the block (it works like a recording index counter); default 0 |
| 18–21 | time-of-day sample address code: a 32-bit binary number, least significant byte first, the number of the first sample of the block since midnight, laid down when the signal was first encoded and never changed afterwards; all zeros is midnight (00:00:00:00); turning it into a timecode needs the exact sampling frequency |
| 22 | reliability flags: bits 0–3 reserved, zero; bit 4 bytes 0–5, bit 5 bytes 6–13, bit 6 bytes 14–17, bit 7 bytes 18–21 are unreliable when set |
| 23 | cyclic redundancy check of bytes 0 to 22: generating polynomial x8 + x4 + x3 + x2 + 1, the register preset to all ones, bits taken least significant first. The EBU’s two worked examples are reproduced by the explorer: byte 0 = 01 gives 32; bytes 3D 02 00 00 02 (the rest zero) give 9B. A transmitter with the minimum implementation leaves it zero, which the explorer accepts; any other wrong value is reported |
With bit 0 of byte 0 clear the consumer layout of IEC 60958-3 applies (values as in alsa-lib’s asoundef.h; fields read with
bit 0 as the least significant bit):
| Byte | Consumer layout |
|---|---|
| 0 | bit 0 clear (consumer); bit 1: 0 linear PCM, 1 other data; bit 2: 0 copyright asserted, 1 not asserted; bits 3–5 pre-emphasis: 0 two audio channels without pre-emphasis, 1 with 50/15 µs pre-emphasis, others reserved; bits 6–7 mode, 0 is the only one defined |
| 1 | bits 0–6 category code, bit 7 the generation status bit L (its meaning depends on the category: for most, original or pre-recorded against a copy). Categories: 0x00 general; 0x01 CD player (IEC 60908), 0x09 CD-compatible not IEC 60908, 0x19 DVD, 0x49 MiniDisc, 0x79 other laser-optical; 0x02 PCM coder, 0x12 mixer, 0x1A sample rate converter, 0x22 sampler, 0x2A digital sound processor, 0x7A other digital converter; 0x03 DAT, 0x0B video recorder, 0x43 digital compact cassette, 0x1B magnetic disc, 0x7B other magnetic; 0x04 DAB Japan, 0x0C DAB Europe, 0x64 DAB USA, 0x44 electronic software delivery, 0x24 IEC 62105, 0x7C other broadcast; 0x05 synthesizer, 0x0D microphone, 0x7D other musical; 0x06 A/D converter without copyright information, 0x66 other such; 0x16 A/D converter with copyright information, 0x76 other such; 0x08 solid-state recorder or player, 0x78 other solid-state memory; 0x40 experimental; the rest reserved |
| 2 | bits 0–3 source number, bits 4–7 channel number (0 unspecified; A is 1, B is 2) |
| 3 | bits 0–3 sampling frequency: 0 44.1 kHz, 1 not indicated, 2 48, 3 32, 4 22.05, 6 24, 8 88.2, 9 768, 10 96, 12 176.4, 14 192 kHz; bits 4–5 clock accuracy: 0 1000 ppm, 1 50 ppm, 2 variable pitch; bits 6–7 reserved |
| 4 | bit 0 maximum word length (0 is 20 bits, 1 is 24); bits 1–3 sample word length: 0 not indicated; 1, 2, 4, 5, 6 are 16, 18, 19, 20, 17 bits with a 20-bit maximum and 20, 22, 23, 24, 21 bits with a 24-bit maximum; bits 4–7 original sampling frequency: 0 not indicated, 1 192 kHz, 2 12, 3 176.4, 5 96, 6 8, 7 88.2, 8 16, 9 24, 10 11.025, 11 22.05, 12 32, 13 48, 15 44.1 kHz |
| 5 | bits 0–1 CGMS-A copy management: 0 copying permitted without restriction, 1 one generation of copies may be made, 2 condition not to be used, 3 no copying permitted; the rest reserved |
| 6–23 | reserved, zero |
APPL: application specific
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 4 | ID | applicationSignature | the application’s four-character signature; Apple II software uses pdos |
| 4 | … | bytes | data | its own data; with the pdos or stoc signature, this starts with a Pascal string naming the application |
The signature is the application’s four-character signature for Macintosh applications; pdos (0x70646F73) for Apple II
applications; and stoc for applications that run on other than Apple computers (AIFF-C draft, section 12). For both
pdos and stoc the data begins with a Pascal string (a length byte, then that many ASCII characters) that names the
application, and the data, including that string, is padded with a byte to an even length (the pad is not in ckDataSize). Any number of
APPL chunks may appear. Signatures seen in files: m3ga, which libsndfile writes for its “software” string
(assigned to Mega Nerd Pty Ltd by Apple; the rest of the chunk is the text itself, with no length byte, padded with a zero to an even length), and
stoc with the name VADPCMCODES, which FFmpeg reads: the data after that name is the Nintendo 64 VADPCM
codebook (needed to decode compression type VAPC), which FFmpeg passes to its decoder as extra data.
SAXL: sound accelerator
Section 8 and Appendix D of the AIFF-C draft (26 August 1991) define a sound accelerator chunk, meant to avoid the artefacts of starting to decompress part-way through a file, at a marker. The draft calls the whole chunk “under construction” and “a possible, not a probable, implementation”, and no final form was published, but the layout it gives is exact and the explorer reads it. Several SAXL chunks may appear in one FORM.
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | u16 | numSaxels | the number of saxels that follow |
| then, for each saxel (packed, each an even number of bytes): | ||||
| 0 | 2 | s16 | id | the MarkerId of the marker the data is for; a saxel for every marker is good practice |
| 2 | 2 | u16 | size | the length of saxelData in bytes, without the pad byte |
| 4 | size | bytes | saxelData | compression-specific data, then a zero pad byte if size is odd |
For ACE2, ACE8, MAC3 and MAC6, saxelData is the 48 frames of
compressed sound that precede the marker (frames of 1, 3, 2 and 1 bytes: see
Appendix C), or the compressed sound from the start up to
the frame that holds the marker’s sample when there are fewer than 48; a marker at the very start has no saxel.
A player feeds the saxel data to the expander without playing it, which settles the expander’s state, then starts at the marker.
For MACE 3:1 a marker at position 6 to 11 has a 2-byte saxel (bytes 0 to 1), at 12 to 17 a 4-byte one, up to 96 bytes for the
48 frames before positions of 288 and beyond, which then slide forward by one frame for each 6 positions.
Other compression types define their own saxel data.
Text chunks
| ID | Meaning | Number |
|---|---|---|
NAME | the name of the sound | at most one |
AUTH | the author | at most one |
(c) | the copyright notice; the c is lower case and a space follows the parenthesis | at most one |
ANNO | a comment; COMT is preferred | any number |
Other chunks in the wild
Software adds chunks the specification does not define. Readers skip what they do not know.
| ID | Use |
|---|---|
CHAN | Apple’s channel layout, as in CAF: a u32 layout tag (layout number in the top 16 bits, channel count in the low 16), a u32 channel bitmap, a u32 count of descriptions, then that many 20-byte descriptions (u32 label, u32 flags, three f32 coordinates). Apple writes room for one description even when the count is 0, so a 32-byte chunk with a count of 0 is normal. |
PEAK | peak values, used by libsndfile: u32 version (1), u32 time stamp (Unix seconds), then for each channel an f32 peak value and a u32 frame position |
basc | Apple Loops information, read by libsndfile: u32 version, u32 beats, u16 root note, u16 scale (1 minor, 2 major, 3 neither, 4 both), u16 time signature numerator and denominator, u16 loop type (0 loop, 1 one shot). The chunk in Apple’s own loop DrumKit.aif (Motion) is 84 bytes: 8 beats, root note 3, scale 4, 4/4, loop type 1, and the 66 bytes after these 18 are all zero. Apple’s own writer (MAFiles, aifChunkDataFromCombinedTagsChunkDataDictionary:, which names the fields root note, key type, beat count and signature top and bottom) stores exactly these 18 bytes (version 1, then five u16 values after the beat count) into a zeroed structure, so the rest is zero padding. The Apple Loops Utility manual lists the scale types Major, Minor, Good for Both and Neither, and the time signatures 4/4, 3/4, 5/4, 6/8 and 7/8. |
trns | Apple Loops transients (slices). Apple publishes no document, so the layout is read from Apple’s own code, the AppleLoopTransientChunkData methods readFromAIFData: and aifDataRepresentation in the MAFiles framework of GarageBand (arm64), and checked against DrumKit.aif, whose 868 bytes are a 76-byte header and 33 records. Header: u16 version (1), u16 transient detection percentage (the Sensitivity slider of Apple Loops Utility, 0 to 100; 49 in the file), u16 force division value (the Transient Division setting; 16, the sixteenth note that the utility’s manual gives as the default), u16 zero, u32 creation time (Unix seconds from time(); 0x3EA1822C is 19 April 2003, 17:06:52 UTC), 60 bytes that the writer never sets (zero), and a u32 count of records at byte 72. Each 24-byte record: u16 transient type (1 in every record of the file; Apple’s code has no names for other values), u16 zero, u32 sample frame of the transient (0, 4,865, 9,730 … 155,586 in that file, inside its 155,686 frames), then 16 zero bytes. The go-audio/aiff library’s commented sketch has the same 24-byte records from byte 76. Sources: Apple, Apple Loops Utility User Manual (Sensitivity, Transient Division); the MAFiles disassembly. |
cate | Apple Loops categories, as go-audio/aiff reads them, matched against DrumKit.aif (522 bytes): u32 (1), four 50-byte zero-terminated texts (instrument, instrument category, style, substyle: “Drums”, “Drum Kit”, “Rock/Blues”, empty), 16 bytes (zero), i16 count of descriptors, then that many 50-byte texts (“Single”, “Part”, “Acoustic”, “Dry”, “Clean”, “Grooving”). Apple’s own writer (MAFiles, combinedAifChunkDataFrom:andCategoryData:) agrees: it copies each text with strlcpy into a 50-byte slot and sizes the chunk as 222 bytes plus 50 for each descriptor, the count (u16) sitting at byte 220. |
ID3 , id3 | an ID3v2 tag, read by FFmpeg; the explorer shows every frame, the pictures and offers each picture as a file. An empty chunk occurs. |
wave | QuickTime atoms (u32 size, four-character type, data) that carry codec data for QDesign and QCELP audio, read by FFmpeg. Apple’s QuickTime File Format documentation defines this as the siDecompressionParam atom (wave), which holds other atoms with out-of-band decoder settings, including a format atom (frma, a u32 data format), codec-specific atoms such as esds, and a terminator atom (size and a type of zero). It does not document enda; FFmpeg’s mov_read_enda reads a u16 and treats a low byte of 1 as little-endian samples; the explorer names the atoms (frma, enda, esds, terminator). FFmpeg reads parameters from the chunk’s raw bytes: for QDesign (QDMC, QDM2) the big-endian u32 at byte 36 is the number of sample frames in a packet and the u32 at byte 44 the packet size in bytes (with the usual frma atom of 12 bytes first, those are the group size and packet size words of the QDCA atom: see QDM2), used only when the chunk is at least 48 bytes long; for QCELP (Qclp, Qclq) byte 24 is the rate letter, H for half rate (17-byte packets) and anything else, F included, for full rate (35-byte packets), each packet holding 160 samples; a QCELP file with no wave chunk is taken as full rate |
APCM | CD-ROM XA ADPCM sound that takes the place of SSND, read by FFmpeg: two u32 fields (the first unknown and unused, the second the block size), then 128-byte sound groups of eight 28-sample units (224 samples a mono group; stereo alternates units between the channels). The explorer decodes it, equal to FFmpeg on random groups; the layout of the groups is in its decoder notes and FFmpeg’s xa_decode. |
FLLR | filler that Apple software writes to align the sound data, zeros |
uMrk | a binary property list (bplist00, an NSKeyedArchiver archive) written by Apple software; seen in files of iOS accessibility bundles |
ResU | Logic Pro: a zlib stream of JSON text, an analysis of the audio; the explorer inflates it as an embedded file |
LGWV | Logic Pro: a u32 frame count (equal to numSampleFrames in the files seen) then a u32 modification date of the audio file (seconds since 1 January 1904; Logic’s ReadOverviewFromAudioFile compares it with the file’s own date and drops a stale overview) and a coarse waveform overview: two signed bytes, a minimum and a maximum, for every block of 256 sample frames, rounded up (8 + 2 × blocks bytes in all, e.g. 582 bytes for 73,445 frames: 287 blocks). In the three mono 16-bit GarageBand files measured, Logic’s values equal the top byte of the lowest and highest sample of the block in 81 to 97 per cent of the blocks (the three files differ) and differ by a few steps in the rest; Logic’s own routine that fills them (an overview it computes from its analysis) was not followed through |
LGBM | Logic Pro: transient markers (Flex Time). From Logic’s code (MADSPTransientService::WriteChunk in MADSP.framework and SwapTransientCallback in MACore.framework): a 1,024-byte header, then 36-byte records. In the header the first five words are big-endian: 0x08091976, a word of 8, the number of records, a tempo word (a 32-bit float) and a word taken from Logic’s transient list (−1 in the file seen); the other 1,004 bytes are Logic’s structure written from memory without byte-swapping (they hold 64-bit pointers). A record is read as one 64-bit value, four 32-bit values, two 32-bit values and one 32-bit value; the writer starts every record with a float of 1e-6 at byte 16 before copying the transients in. In Logic’s Kick.aif (one record) they are 0, 1.0, 0, 1e-6, 4, 0.9969, 0, 0. What the values mean is not stated anywhere read. |
EAPD | Logic Pro: Elastic Audio pitch data. From Logic’s code (CEAPitchChunkConcrete in MADSP.framework): a 24-byte header of six 32-bit words, in the byte order of the machine that wrote it (little-endian in the files seen; the second word is non-zero when the chunk is big-endian and still to be swapped): offset of the data (24), the swap flag, a version (12 or 13 are accepted), the size of a value (4), the number of values, the hop size in sample frames between values. Then that many 32-bit floats, the period of the pitch at each hop (a value that is not finite is taken as 0). Logic’s Kick.aif: 736 values every 128 frames for 93,148 frames. |
EAFP | Logic Pro: Flex Pitch events (CFlexPitchEventConcrete). Logic checks the version word at byte 4 for 12 and a float at byte 20 against the expected value; the records themselves (ConvertChunkToVector) were not decoded, so the viewer shows the chunk as bytes. |
minf, elm1, regn, umid, DGDA | Digidesign Pro Tools chunks (seen in the Final Cut Pro sound library); not documented anywhere public, shown as bytes. umid is 24 bytes, DGDA holds analysis set names as text. |
SFX! | skipped by libsndfile; contents not documented |
Writers pad chunks with zeros after their fields (Logic’s comments chunk can be 410 bytes for 30 bytes of text); the explorer labels that zero padding without calling it a problem. A few writers leave out the pad byte of an odd chunk; the explorer then notices that the next chunk ID starts where the pad byte should be.