AAC (Advanced Audio Coding)
A lossy audio codec standardized as part of MPEG-2 and MPEG-4, designed to supersede MP3 with better quality at equivalent or lower bitrates.
You are a file format specialist with deep expertise in AAC (Advanced Audio Coding). You understand its MPEG-2/MPEG-4 standardization, the family of profiles (AAC-LC, HE-AAC v1/v2, AAC-LD, AAC-ELD, xHE-AAC), encoder quality differences between Apple CoreAudio, FDK-AAC, and FFmpeg native, and the nuances of ADTS vs. MP4/M4A containers. You can advise on encoding settings, profile selection for different use cases, bitrate optimization, and integration into streaming and broadcast workflows. ## Key Points - **FFmpeg (native encoder)**: `ffmpeg -i input.wav -codec:a aac -b:a 256k output.m4a` - **FFmpeg (FDK-AAC, higher quality)**: `ffmpeg -i input.wav -codec:a libfdk_aac -vbr 5 output.m4a` - **Apple's CoreAudio (macOS)**: `afconvert -f m4af -d aac -b 256000 input.wav output.m4a` - **Nero AAC Encoder**: `neroAacEnc -q 0.5 -if input.wav -of output.m4a` - **qaac (Windows, uses Apple encoder)**: `qaac -V 109 input.wav -o output.m4a` - **To WAV**: `ffmpeg -i input.m4a output.wav` - **To MP3**: `ffmpeg -i input.m4a -codec:a libmp3lame -V 2 output.mp3` - **To FLAC**: `ffmpeg -i input.m4a output.flac` 1. Apple CoreAudio / qaac (best overall quality) 2. FDK-AAC (excellent; used in Android) 3. FFmpeg native AAC encoder (good since FFmpeg 3.0+) 4. FAAC (outdated; avoid)
skilldb get file-formats-skills/AAC (Advanced Audio Coding)Full skill: 150 linesYou are a file format specialist with deep expertise in AAC (Advanced Audio Coding). You understand its MPEG-2/MPEG-4 standardization, the family of profiles (AAC-LC, HE-AAC v1/v2, AAC-LD, AAC-ELD, xHE-AAC), encoder quality differences between Apple CoreAudio, FDK-AAC, and FFmpeg native, and the nuances of ADTS vs. MP4/M4A containers. You can advise on encoding settings, profile selection for different use cases, bitrate optimization, and integration into streaming and broadcast workflows.
AAC — Advanced Audio Coding
Overview
AAC (Advanced Audio Coding) is a lossy audio compression codec designed as the successor to MP3. Standardized in 1997 as part of MPEG-2 (ISO/IEC 13818-7) and later enhanced in MPEG-4 (ISO/IEC 14496-3), AAC consistently delivers better audio quality than MP3 at equivalent bitrates, particularly at lower bitrates below 128 kbps.
AAC was developed by a consortium including Fraunhofer IIS, Dolby Laboratories, AT&T Bell Labs, Sony, and Nokia. It became widely prominent when Apple adopted it as the default format for iTunes and the iPod ecosystem in 2003. Today, AAC is the mandatory audio codec for MPEG-4 video, used by YouTube, and is the default audio format on Apple devices, many streaming services, and digital broadcast standards (DAB+, DVB).
Unlike MP3, AAC is not a single codec but a family of profiles with varying complexity and capability.
Core Philosophy
AAC exists to deliver better audio quality than MP3 at equivalent or lower bitrates. When working with AAC, the guiding principle is to let the codec do what it was designed for: efficient perceptual coding that preserves the listening experience while minimizing file size. Choose AAC over MP3 for any new project — it is technically superior at every bitrate and has universal hardware and software support.
Respect the codec's sweet spots. AAC-LC at 128-256 kbps covers the vast majority of consumer listening scenarios. HE-AAC v1 and v2 exist specifically for low-bitrate streaming (talk radio, podcasts, mobile networks) and should not be used at high bitrates where they offer no advantage over LC. Match the AAC profile to the delivery context rather than defaulting to maximum quality settings that waste bandwidth without audible benefit.
Treat AAC as a delivery format, not an archival one. Always keep lossless masters (FLAC, WAV, ALAC) and encode to AAC as a final step. Re-encoding from one lossy format to another compounds artifacts — transcode from lossless sources whenever possible.
Technical Specifications
| Property | Details |
|---|---|
| File Extension | .aac, .m4a, .mp4, .3gp |
| MIME Type | audio/aac, audio/mp4 |
| Codec | MPEG-2/MPEG-4 AAC |
| Compression | Lossy |
| Bitrate | 8 kbps to 529 kbps per channel |
| Sample Rates | 8 to 96 kHz |
| Channels | Up to 48 channels (standard profiles: mono to 7.1 surround) |
| Bit Depth | Up to 32-bit (internal processing) |
| Container | ADTS (raw), MP4/M4A (MPEG-4), ADIF |
| Metadata | MP4/iTunes metadata atoms (artist, album, cover art, etc.) |
AAC Profiles
| Profile | Use Case | Features |
|---|---|---|
| AAC-LC (Low Complexity) | General music, streaming | Most widely supported; good quality ≥128 kbps |
| HE-AAC v1 (aacPlus) | Low-bitrate streaming | Spectral Band Replication (SBR); effective at 48-80 kbps |
| HE-AAC v2 | Very low-bitrate speech/music | SBR + Parametric Stereo; effective at 24-48 kbps |
| AAC-LD (Low Delay) | Real-time communication | Low algorithmic delay (~20 ms) |
| AAC-ELD (Enhanced Low Delay) | VoIP, conferencing | Combines LD with SBR; FaceTime audio uses this |
| xHE-AAC (Extended HE) | Adaptive streaming | USAC-based; scales from 12 kbps speech to high-quality music |
Quality Comparison with MP3
At equivalent bitrates, AAC typically offers a 25-30% improvement in perceptual quality. An AAC file at 128 kbps is generally comparable to MP3 at 160-192 kbps.
How to Work With It
Opening / Playing
Native playback on all major platforms. Virtually every modern device and media player supports AAC-LC. HE-AAC and xHE-AAC support varies.
Creating / Encoding
- FFmpeg (native encoder):
ffmpeg -i input.wav -codec:a aac -b:a 256k output.m4a - FFmpeg (FDK-AAC, higher quality):
ffmpeg -i input.wav -codec:a libfdk_aac -vbr 5 output.m4a - Apple's CoreAudio (macOS):
afconvert -f m4af -d aac -b 256000 input.wav output.m4a - Nero AAC Encoder:
neroAacEnc -q 0.5 -if input.wav -of output.m4a - qaac (Windows, uses Apple encoder):
qaac -V 109 input.wav -o output.m4a
Converting
- To WAV:
ffmpeg -i input.m4a output.wav - To MP3:
ffmpeg -i input.m4a -codec:a libmp3lame -V 2 output.mp3 - To FLAC:
ffmpeg -i input.m4a output.flac
Encoder Quality Ranking
- Apple CoreAudio / qaac (best overall quality)
- FDK-AAC (excellent; used in Android)
- FFmpeg native AAC encoder (good since FFmpeg 3.0+)
- FAAC (outdated; avoid)
Common Use Cases
- Apple ecosystem audio (iTunes Store, Apple Music, iPhone recordings)
- YouTube audio track encoding
- Digital radio broadcasting (DAB+)
- Video soundtracks (MP4/M4V containers)
- Low-bitrate streaming (HE-AAC for internet radio, podcasts)
- VoIP and conferencing (AAC-ELD in FaceTime)
- Mobile voice recording
Pros & Cons
Pros
- Superior quality to MP3 at equivalent bitrates
- Excellent low-bitrate performance with HE-AAC profiles
- Native surround sound support (5.1, 7.1)
- Sample rates up to 96 kHz
- Universal hardware and software support
- Efficient profiles for different use cases (music, speech, real-time)
- Gapless playback support in MP4 container
Cons
- Licensing/patent situation historically complex (though most patents expired by 2023)
- Multiple encoder implementations with varying quality
- Raw ADTS streams lack metadata; requires MP4 container for full features
- Not a single format but a family of profiles, leading to compatibility confusion
- Open-source encoder options historically lagged behind proprietary ones
- Slightly more CPU-intensive to decode than MP3
Compatibility
| Platform | Support |
|---|---|
| Windows | Native (Windows 7+) |
| macOS | Native (all modern versions) |
| Linux | Via FFmpeg, GStreamer (not always preinstalled due to patents) |
| iOS | Native (primary audio format) |
| Android | Native (AAC-LC, HE-AAC) |
| Web Browsers | All modern browsers |
| Hardware | Virtually all modern portable players, car stereos, TVs |
Related Formats
- MP3 — Predecessor; less efficient but more universally recognized
- Opus — Newer, royalty-free codec that outperforms AAC at most bitrates
- M4A — The typical container for AAC audio files
- HE-AAC — High-efficiency profile for low-bitrate streaming
- AC3/E-AC3 — Dolby's surround codecs; different niche
- xHE-AAC — Latest evolution supporting USAC for extreme low bitrates
Practical Usage
- Podcast encoding: Encode mono speech at 64 kbps HE-AAC v1 for excellent quality at half the file size of 128 kbps AAC-LC, or use AAC-LC at 96 kbps mono for broader player compatibility.
- Music distribution for Apple ecosystem: Use
qaac -V 109(TVBR ~256 kbps) orffmpeg -codec:a libfdk_aac -vbr 5for transparent quality that is indistinguishable from the source for most listeners. - Video soundtrack encoding: When muxing into MP4 video, use AAC-LC at 192-256 kbps stereo for broad compatibility across all devices and browsers.
- Low-bitrate streaming: Use HE-AAC v2 at 32-48 kbps for internet radio or mobile streaming where bandwidth is constrained, trading some quality for dramatically smaller streams.
- Transcoding pipeline: Always encode AAC from a lossless source (WAV, FLAC, ALAC) rather than from another lossy format to avoid generation loss from cascaded lossy compression.
Anti-Patterns
- Re-encoding from MP3 to AAC expecting quality improvement — Transcoding between lossy formats always degrades quality. AAC is better than MP3 only when encoding from a lossless source.
- Using the FFmpeg native AAC encoder when FDK-AAC is available — The native encoder is adequate but FDK-AAC produces measurably better results, especially at lower bitrates. Check
ffmpeg -encoders | grep aacto see what is available. - Choosing raw ADTS streams for file distribution — ADTS lacks metadata, gapless playback info, and seeking efficiency. Always wrap AAC in an M4A/MP4 container for distribution.
- Using AAC-LC at very low bitrates (below 80 kbps stereo) — AAC-LC falls apart below 80 kbps. Switch to HE-AAC v1 or v2 for low-bitrate scenarios where they are designed to excel.
- Assuming all AAC files are the same — A poorly encoded AAC file from FAAC at 128 kbps can sound worse than a well-encoded MP3. The encoder implementation matters as much as the format.
Install this skill directly: skilldb add file-formats-skills
Related Skills
3MF 3D Manufacturing Format
The 3MF file format — the modern replacement for STL in 3D printing, supporting colors, materials, multi-object assemblies, and precise manufacturing data in a single package.
7-Zip Compressed Archive
The 7z archive format — open-source high-ratio compression using LZMA2, with strong AES-256 encryption, solid archives, and multi-threading support.
AC3 (Dolby Digital)
Dolby's surround sound audio codec used in cinema, DVD, Blu-ray, and broadcast television for multichannel 5.1 audio delivery.
AI Adobe Illustrator Format
AI is Adobe Illustrator's native vector graphics file format, used for
AIFF (Audio Interchange File Format)
Apple's uncompressed audio format storing raw PCM data, serving as the Mac equivalent of WAV for professional audio production.
ALAC (Apple Lossless Audio Codec)
Apple's lossless audio compression codec, storing bit-perfect audio at roughly half the size of uncompressed PCM, natively integrated across all Apple devices.