Introduction
AAC is the lossy audio codec of the MPEG-2 and MPEG-4 standards, designed as the successor to MP3. At the same bit rate it usually sounds better. It is the standard audio of the iTunes Store and Apple Music, YouTube, digital television and most phones, and comes in several profiles, such as AAC-LC and the lower-rate HE-AAC.
AAC audio reaches users in two kinds of file. A .aac file is usually a
raw stream of ADTS frames. An .m4a file holds AAC inside an MPEG-4
container with tags and cover art; the same extension is used for Apple
Lossless.
Structure
An ADTS stream is a run of frames, each with its own header so a player can start
anywhere. The header is 7 bytes, or 9 with a CRC. It starts with a 12-bit sync word of
ones (FFF), then gives the MPEG version, whether a CRC is present, the
profile, a sampling-rate index, the channel configuration and the 13-bit frame length
including the header. The compressed audio follows. Each AAC frame normally decodes to
1024 samples per channel.
In an .m4a file the frames carry no headers. They sit in an
mdat box, and the moov box holds the codec settings (in an
mp4a sample entry), the sample tables and the tags.
0ADTS frame repeated to the end of the streamvaries+0Header sync, profile, rate index, channels, frame length7 or 9 bytes+7Raw data one AAC frame, 1024 samples per channelvaries
Also used for
- Apple Lossless Audio Codec – Apple’s lossless codec, stored in an MPEG-4 .m4a file like AAC.
Links
Software
- Apple Music – Apple’s music app, which plays AAC and uses it for its own downloads (macOS, Windows, iOS)
- VLC media player – free player for almost any audio or video file (Windows, macOS, Linux, mobile)
- foobar2000 – free music player and converter (Windows, macOS, mobile)
- Audacity – free audio editor that opens and exports AAC through the FFmpeg library (Windows, macOS, Linux)
- FFmpeg – command-line tool that encodes and decodes AAC (Windows, macOS, Linux)