The field at offset 12 of the header says how the audio is stored. Values up to 255 were reserved for assignment by the format’s authority, first NeXT and later Oracle; other values can be used for private formats.
Codes
Linear formats are signed, centred on zero, and most significant byte first.
| Code | Name | Size | Meaning |
|---|---|---|---|
| 0 | unspecified | no encoding given | |
| 1 | MULAW_8 | 1 | G.711 µ-law |
| 2 | LINEAR_8 | 1 | 8-bit signed linear PCM |
| 3 | LINEAR_16 | 2 | 16-bit signed linear PCM |
| 4 | LINEAR_24 | 3 | 24-bit signed linear PCM |
| 5 | LINEAR_32 | 4 | 32-bit signed linear PCM |
| 6 | FLOAT | 4 | 32-bit IEEE floating point |
| 7 | DOUBLE | 8 | 64-bit IEEE floating point |
| 8 | INDIRECT | fragmented sample data | |
| 9 | NESTED | nested; its contents are not described | |
| 10 | DSP_CORE | a DSP program | |
| 11 | DSP_DATA_8 | 1 | 8-bit fixed point |
| 12 | DSP_DATA_16 | 2 | 16-bit fixed point |
| 13 | DSP_DATA_24 | 3 | 24-bit fixed point |
| 14 | DSP_DATA_32 | 4 | 32-bit fixed point |
| 15 | unassigned | ||
| 16 | DISPLAY | non-audio display data | |
| 17 | MULAW_SQUELCH | µ-law with squelch | |
| 18 | EMPHASIZED | 2 | 16-bit linear with emphasis |
| 19 | COMPRESSED | 16-bit linear, compressed | |
| 20 | COMPRESSED_EMPHASIZED | 16-bit linear with emphasis and compression | |
| 21 | DSP_COMMANDS | Music Kit DSP commands | |
| 22 | DSP_COMMANDS_SAMPLES | Music Kit DSP command samples | |
| 23 | ADPCM_G721 | 4 bits | CCITT G.721 ADPCM, 32 kbit/s |
| 24 | ADPCM_G722 | CCITT G.722 sub-band ADPCM | |
| 25 | ADPCM_G723_3 | 3 bits | CCITT G.723 ADPCM, 24 kbit/s |
| 26 | ADPCM_G723_5 | 5 bits | CCITT G.723 ADPCM, 40 kbit/s |
| 27 | ALAW_8 | 1 | G.711 A-law |
The names without the AUDIO_AU_ENCODING_ or SND_FORMAT_
prefix come from the NeXT and Sun headers as libsndfile, the Solaris manual and McGill’s
notes give them, and where these differ (8 is called fragmented, 19 is called
NEXT by libsndfile) the meaning above is the common one.
The meaning of codes 8, 9, 10 to 14, 16, 17, 19, 21 and 22 is only known from these names; the structure of that data is not publicly documented.
FFmpeg also recognises the private value 0x37323632
(7262) for little-endian G.726. It is not an assigned code.