AAC Audio Format: The Complete Technical Guide
AAC (Advanced Audio Coding) is the dominant lossy audio codec for mainstream digital distribution, streaming, and mobile devices. Standardized as ISO/IEC 13818-7 (MPEG-2 AAC) in 1997 and extended in MPEG-4 (ISO/IEC 14496-3), AAC was designed from the ground up to surpass MP3's limitations. At equal perceived quality, AAC achieves roughly 30% smaller file sizes than MP3 — a 192 kbps AAC file sounds comparable to a 256 kbps MP3.
Historical Context and Standardization
AAC emerged from the MPEG Audio work that produced MP3 but incorporated significant advances from Dolby Laboratories, AT&T Bell Labs, Sony, Nokia, and Fraunhofer IIS. The original MPEG-2 AAC (1997) improved on MP3 in several ways: more filter bank channels, temporal noise shaping (TNS), perceptual noise substitution (PNS), and better joint stereo modes. MPEG-4 AAC (1999) extended it further with Scalable Sample Rate (SSR), Long Term Prediction (LTP), and eventually the HE-AAC (High-Efficiency AAC) family. Apple adopted AAC as the default format for iTunes in 2003, cementing its mainstream position. YouTube, Spotify, Apple Music, Netflix, and virtually all streaming services use AAC as their primary delivery codec.
AAC Profiles and Object Types
AAC is not a single codec but a family of profiles:
AAC-LC (Low Complexity): The most widely used profile. Requires modest CPU for decoding, universal hardware support. Used by iTunes, Apple Music, YouTube, most streaming services. The baseline for all AAC comparison.
HE-AAC v1 (High-Efficiency AAC, aacPlus v1): AAC-LC core + Spectral Band Replication (SBR). SBR encodes only the lower half of the spectrum in the AAC-LC core and reconstructs the upper half at decode time using spectral envelope information. Excellent at 48–80 kbps — sounds better than AAC-LC at 128 kbps at these bitrates. Used for DAB+ digital radio, internet radio streams, podcast delivery.
HE-AAC v2 (aacPlus v2): HE-AAC v1 + Parametric Stereo (PS). PS encodes a mono downmix plus stereo parameters (inter-channel level differences, inter-channel phase differences, inter-channel coherence). Usable down to 24–32 kbps — the lowest quality audio that still sounds like stereo. Used for lowest-bitrate internet radio streams.
AAC-LD (Low-Delay): Algorithmic delay reduced to ~20 ms (vs. ~60 ms for AAC-LC). Used for real-time communication. Used in FaceTime audio calls.
AAC-ELD (Enhanced Low-Delay): Combines AAC-LD with SBR. Delay as low as ~15 ms. Used in Apple FaceTime HD, professional IP audio.
xHE-AAC (Extended HE-AAC / USAC): MPEG-D Unified Speech and Audio Coding (ISO/IEC 23003-3). Combines AAC-ELD, HE-AAC v2, and new tools (ACELP coding for speech, harmonic transient shaping). Quality comparable to Opus. Used in MPEG-H Audio for broadcasting.
Technical Architecture: AAC-LC
Filter Bank: Modified Discrete Cosine Transform
AAC-LC uses a pure MDCT filter bank (unlike MP3's hybrid polyphase+MDCT):
- Long windows (N=2048 samples → 1024 spectral lines): Normal mode, high frequency resolution
- Short windows (N=256 samples → 128 spectral lines, 8 per long-window period): Transient mode, high time resolution
- Start/Stop transition windows: Smooth switching between long and short blocks
The larger MDCT size (1024 vs. MP3's 576 lines) provides better frequency resolution and more efficient coding of stationary audio.
Psychoacoustic Model and Bit Allocation
AAC uses a more sophisticated psychoacoustic model than MP3:
1. FFT analysis: 2048-point FFT for masking threshold computation, simultaneous with MDCT 2. Spreading function: Models upward and downward masking across critical bands (Bark scale, 49 short-term masking bands) 3. Temporal masking: Pre-masking (2 ms before masker) and post-masking (up to 200 ms after masker) 4. Tonality estimation: Distinguishes tonal components (sinusoids) from noise components for different masking thresholds 5. Rate-distortion optimization: Allocates bits to minimize perceptual distortion subject to bit budget
Temporal Noise Shaping (TNS)
TNS is one of AAC's key advances over MP3. It applies LPC prediction in the frequency domain to shape the temporal distribution of quantization noise. For signals with strong tonal components that vary rapidly over time (speech, drums, piano attacks), TNS prevents the psychoacoustic model from producing pre-echo artifacts by concentrating noise within the signal's temporal masking region.
Perceptual Noise Substitution (PNS)
For spectral bands deemed to be noise-like (non-tonal), AAC replaces the actual spectral coefficients with a synthesized noise signal of matching power level. Only the noise energy is transmitted — not the actual spectral shape. This frees bits for more complex tonal components, improving overall quality at low bitrates.
Joint Stereo: Mid/Side and Intensity Coding
- Mid/Side (MS) stereo: Encodes L+R and L-R signals. Applied band-by-band based on which representation is more efficient. More flexible than MP3's whole-frame MS.
- Intensity stereo: For high-frequency bands where the ear cannot localize, one channel's phase is discarded and only a single channel's magnitude is transmitted with a steering angle. Significant bit savings for content where stereo imaging above 6 kHz is imperceptible.
Scale Factors and Huffman Coding
AAC uses 49 scale factor bands (groups of spectral lines matched to critical bands). Scale factors are DPCM-coded relative to the previous band. Spectral coefficients within each scale factor band are quantized and coded using one of 11 unsigned Huffman codebooks (cb=1–10 for pairs of coefficients, cb=11 for quadruples of ±1,0 coefficients).
Bitrate Reference: AAC-LC
| Bitrate | Perceived Quality | Equivalent MP3 | Use Case |
|---|---|---|---|
| 32 kbps | AM radio | 48 kbps MP3 | Podcast mono |
| 64 kbps | Good stereo | 96 kbps MP3 | Streaming (podcast) |
| 96 kbps | Transparent for most | 128 kbps MP3 | Standard streaming |
| 128 kbps | High quality | 192 kbps MP3 | Apple Music 256 kbps (was 128) |
| 192 kbps | Near-transparent | 256 kbps MP3 | High-quality streaming |
| 256 kbps | Transparent | 320 kbps MP3 | Apple Music current standard |
| 320 kbps | Archival lossy | — | Maximum AAC-LC |
Apple Music streams at 256 kbps AAC-LC (encoded with Apple's proprietary AAC encoder, which is considered higher quality than open-source alternatives at the same bitrate).
Container Formats
AAC audio is stored in multiple container formats:
- M4A (
.m4a): MPEG-4 audio container (ISO Base Media File Format). The standard iTunes/Apple container. Contains one AAC audio track + metadata. Supports ID3v2-compatible iTunes metadata (iTunNORM, thumbnail, etc.). - MP4 (
.mp4): Same as M4A but typically contains video + audio. AAC is the standard audio track in MP4 video. - ADTS (
.aac): Audio Data Transport Stream. Raw AAC frames with a 7–9 byte sync header per frame. Streamable but no container metadata. Simpler than M4A, used in HLS segment delivery. - ADIF (
.aac): Audio Data Interchange Format. Single header block at file start. For file delivery, not streaming. - Ogg (
.oga): AAC in Ogg container. Uncommon but valid.
Encoding Commands
# FFmpeg: AAC-LC at 192 kbps (using native encoder)
ffmpeg -i input.wav -c:a aac -b:a 192k output.m4a
# FFmpeg: AAC using libfdk_aac (higher quality encoder, requires FFmpeg rebuild)
ffmpeg -i input.wav -c:a libfdk_aac -b:a 256k output.m4a
# FFmpeg: HE-AAC v1 at 64 kbps (libfdk_aac required)
ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he -b:a 64k output.m4a
# FFmpeg: HE-AAC v2 at 32 kbps
ffmpeg -i input.wav -c:a libfdk_aac -profile:a aac_he_v2 -b:a 32k output.m4a
# FLAC to AAC-LC 256 kbps (Apple-quality archival)
ffmpeg -i input.flac -c:a aac -b:a 256k output.m4a
# Extract AAC from MP4 without transcoding
ffmpeg -i video.mp4 -c:a copy -vn output.m4a
# Batch convert WAV to AAC 192 kbps
for f in *.wav; do ffmpeg -i "$f" -c:a aac -b:a 192k "${f%.wav}.m4a"; done
AAC vs MP3 vs Opus: When to Use Each
| Scenario | Best Format | Reason |
|---|---|---|
| Legacy device compatibility | MP3 | Universal hardware support |
| Apple ecosystem (iOS, iTunes) | AAC M4A | Native support, best encoder |
| Web streaming (modern browsers) | Opus | Better quality at 96–128 kbps |
| Podcast distribution | AAC-LC 128 kbps | iTunes/Spotify compatibility |
| Low-bitrate internet radio | HE-AAC v2 32 kbps | Best quality at ultra-low bitrates |
| Long-term archival | FLAC | Lossless, future-proof |
| WebRTC/VoIP | Opus | Designed for real-time, low latency |
Related conversions
Audio format pairs that come up most often: