ADIF, the Audio Data Interchange Format, is the other transport ISO/IEC 13818-7 defines
for AAC. It is far rarer than ADTS. An ADIF file has
one header at the very start, and the raw data blocks follow it with no further framing,
so a player can only start at the beginning. The file begins with the four bytes
ADIF.
Header fields
| Width in bits | Name | Meaning |
|---|---|---|
| 32 | adif_id | the ASCII bytes ADIF, 41 44 49 46 |
| 1 | copyright_id_present | 1 if the next field is present |
| 72 | copyright_id | a copyright identifier; only if copyright_id_present is 1 |
| 1 | original_copy | 1 original, 0 copy |
| 1 | home | home usage |
| 1 | bitstream_type | 0 constant bit rate, 1 variable bit rate |
| 23 | bitrate | the bit rate in bits a second; for a variable rate, a peak bit rate |
| 4 | num_program_config_elements | the number of program config elements, minus one |
Then, for each program config element:
| Width in bits | Name | Meaning |
|---|---|---|
| 20 | adif_buffer_fullness | the state of the bit reservoir; only if bitstream_type is 0 |
| varies | program_config_element | the channel layout, sample rate and profile, as described under raw data blocks |
The header is not byte-aligned as a whole. The fields follow each other bit by bit, and the first raw data block begins at the next byte boundary after it.
After the header
The rest of the file is raw data blocks, one after another, each normally 1024 samples per channel. Nothing marks where a block starts except the end of the one before it, which is why a decoder can only read an ADIF file from the start and cannot seek without decoding.