An audio tag is a tag of type 8. Its first byte describes the sound and the rest is the
sound data. A SoundFormat of 9 is the signal for
Enhanced FLV, in which the other
bits mean something else.
Audio tag header
| Bits | Name | Meaning |
|---|---|---|
| 7 to 4 | SoundFormat | The codec; see below. |
| 3 to 2 | SoundRate | The sample rate. |
| 1 | SoundSize | Bits per sample. |
| 0 | SoundType | Channels. |
SoundFormat
| Value | Format |
|---|---|
| 0 | Linear PCM, platform endian |
| 1 | ADPCM |
| 2 | MP3 |
| 3 | Linear PCM, little-endian |
| 4 | Nellymoser 16 kHz mono |
| 5 | Nellymoser 8 kHz mono |
| 6 | Nellymoser |
| 7 | G.711 A-law |
| 8 | G.711 mu-law |
| 9 | Reserved in Adobe’s specification; ExHeader in Enhanced FLV |
| 10 | AAC |
| 11 | Speex |
| 12, 13 | Reserved |
| 14 | MP3 8 kHz |
| 15 | Device-specific sound |
SoundRate, SoundSize and SoundType
| SoundRate | Sample rate |
|---|---|
| 0 | 5.5 kHz |
| 1 | 11 kHz |
| 2 | 22 kHz |
| 3 | 44 kHz |
| SoundSize | Sample size |
|---|---|
| 0 | 8-bit samples |
| 1 | 16-bit samples |
| SoundType | Channels |
|---|---|
| 0 | Mono |
| 1 | Stereo |
AAC packets
When SoundFormat is 10, one more byte, AACPacketType, follows
the header byte.
| Value | Contents |
|---|---|
| 0 | AAC sequence header: the AudioSpecificConfig |
| 1 | AAC raw frames |
For other formats the rest of the tag is the codec’s data directly.