LATM, the Low-overhead MPEG-4 Audio Transport Multiplex, and LOAS, the Low Overhead Audio
Stream, are the transports ISO/IEC 14496-3 defines for carrying AAC over broadcast links.
Files with the extensions .latm and .loas hold them, and digital
television carries them inside transport streams. LATM multiplexes one or more
payloads and states their configuration; LOAS adds the synchronisation that lets a
reader join mid-stream.
LOAS: the sync layer
The usual LOAS form, AudioSyncStream, is a run of frames, each holding one
LATM AudioMuxElement:
| Width in bits | Name | Meaning |
|---|---|---|
| 11 | syncword | 0x2B7 |
| 13 | audioMuxLengthBytes | the length in bytes of the AudioMuxElement that follows |
| varies | AudioMuxElement | the multiplexed audio, described below |
The standard also defines AudioPointerStream and
EPAudioSyncStream, for pointer-based and error-protected carriage. They are
rarely seen in files. Their fields are not listed here because the standard could not
be read.
AudioMuxElement
| Width in bits | Name | Meaning |
|---|---|---|
| 1 | useSameStreamMux | 1 reuse the last configuration; 0 a StreamMuxConfig follows |
| varies | StreamMuxConfig | only if useSameStreamMux is 0 |
| varies | PayloadLengthInfo | lengths of the payloads; only when audioMuxVersionA is 0 |
| varies | PayloadMux | the raw data block or other payload |
Reading can only begin at a frame that carries a configuration. Encoders repeat
StreamMuxConfig regularly so a decoder that joins late can start.
StreamMuxConfig
Fields in order, each depending on the ones before:
| Width in bits | Name | Present when | Meaning |
|---|---|---|---|
| 1 | audioMuxVersion | always | 0 or 1; 1 uses the LATM value coding below for certain lengths |
| 1 | audioMuxVersionA | audioMuxVersion is 1 | 0; other values are for a future version |
| LATM value | taraBufferFullness | audioMuxVersion is 1 | buffer fullness |
| 1 | allStreamsSameTimeFraming | always | 1 means every payload has the same framing |
| 6 | numSubFrames | always | number of sub-frames, minus one |
| 4 | numProgram | always | number of programs, minus one |
| 3 | numLayer | for each program | number of layers, minus one |
| varies | AudioSpecificConfig | for each layer that has one | the configuration of that payload; with audioMuxVersion 1 a LATM value ascLen gives its length first |
| 3 | frameLengthType | for each layer | see below |
| varies | type-specific fields | per frameLengthType | see below |
| 1 | otherDataPresent | always | 1 means other data follows the payloads |
| LATM value or groups | otherDataLenBits | otherDataPresent is 1 | with audioMuxVersion 1, a LATM value; with 0, groups of a 1-bit escape then 8 bits, repeated while the escape is 1 |
| 1 | crcCheckPresent | always | 1 means a checksum follows |
| 8 | crcCheckSum | crcCheckPresent is 1 | a checksum of the configuration |
A LATM value is a 2-bit count n, then 8 × (n + 1) bits holding the value.
frameLengthType
| Value | Payload | Field in the configuration |
|---|---|---|
| 0 | variable length, given in each frame | latmBufferFullness, 8 bits |
| 1 | fixed length | frameLength, 9 bits |
| 2 | reserved | none |
| 3, 4, 5 | CELP frames | CELPframeLengthTableIndex, 6 bits |
| 6, 7 | HVXC frames | HVXCframeLengthTableIndex, 1 bit |
PayloadLengthInfo
| frameLengthType | What is read |
|---|---|
| 0 | a run of 8-bit values, added up; a value of 255 means another follows. The total is the length of the payload in bytes |
| 1 | nothing; the length is the configured frameLength |
| 2, 4, 6 | nothing |
| 3, 5, 7 | MuxSlotLengthCoded, 2 bits |