.AAC Advanced Audio Coding
.aac

Advanced Audio Coding

Convert AAC audio files to MP3, WAV, or OGG directly in your browser — no upload, no server. FileDex uses FFmpeg WASM to transcode Advanced Audio Coding locally, preserving audio quality and privacy.

بنية الصيغة
ADTS frame header
CRC error check
Raw encoded audio
Lossy AudioMPEG-2/4AAC-LC / HE-AACPerceptual Coding1997
بواسطة FileDex

ملفاتك لا تغادر جهازك

أسئلة شائعة

Is AAC better quality than MP3 at the same bitrate?

Yes. AAC achieves audibly transparent quality at 128kbps where MP3 typically requires 192kbps for equivalent results. AAC uses more advanced psychoacoustic modeling, temporal noise shaping, and a wider range of transform block sizes.

Can I convert AAC to MP3 without quality loss?

No. Both AAC and MP3 are lossy formats — converting between them is a generation loss operation. The AAC must be fully decoded to PCM, then re-encoded to MP3, discarding additional audio data in the process. At 192kbps+ VBR MP3 output, the additional loss is typically inaudible.

What is the difference between .aac and .m4a files?

A .aac file is raw AAC bitstream with ADTS frame headers. A .m4a file is AAC audio wrapped in an MP4/M4A container, which adds metadata, a seek table, and chapter support. The audio codec inside is the same. M4A is more compatible with media libraries and players.

Why does my .aac file not play in some music players?

Raw ADTS .aac files lack the container metadata that many players expect. Wrap the AAC in an M4A container using FFmpeg with -c:a copy (no re-encoding) to add proper MP4 atoms and seek support. This fixes compatibility with most players.

What AAC profile should I use for music streaming?

AAC-LC at 128-256kbps for standard streaming quality. HE-AAC (with SBR) at 48-64kbps for bandwidth-constrained scenarios like mobile radio or podcasts. HE-AACv2 at 24-32kbps for ultra-low bitrate stereo where some quality trade-off is acceptable.

ما يميز .AAC

Perceptual audio coding reached a turning point when the MPEG-2 committee published Advanced Audio Coding in 1997 as a direct successor to MP3. AAC was not an incremental improvement — it replaced MP3's hybrid filterbank with a pure Modified Discrete Cosine Transform, eliminated the granule structure that limited MP3's frequency resolution, and introduced spectral band replication tools that MP3 never had. The result: AAC at 128 kbps consistently matches or exceeds MP3 at 192 kbps in blind listening tests.

اكتشف التفاصيل التقنية

Codec profiles and their differences

AAC ships in several profiles, each adding tools on top of the base:

  • AAC-LC (Low Complexity): The default profile. Uses a 1024-sample MDCT window, Huffman coding, and mid/side stereo. Targets 96–256 kbps. This is what iTunes, YouTube, and Spotify use for standard streaming.
  • HE-AAC v1: Adds Spectral Band Replication, which encodes frequencies above ~6 kHz as parametric descriptions rather than full waveform data. Effective at 48–80 kbps. Used in DAB+ digital radio and many podcast feeds.
  • HE-AAC v2: Adds Parametric Stereo on top of SBR, encoding the stereo image as parameters applied to a mono core. Targets 24–48 kbps. Common in mobile streaming in bandwidth-constrained markets.
  • xHE-AAC (Extended HE): Uses USAC (Unified Speech and Audio Coding), switching dynamically between speech and music coding modes. Operates from 12 kbps to 500+ kbps. Apple adopted it for Podcasts and FaceTime.

Temporal noise shaping

AAC uses temporal noise shaping (TNS) to redistribute quantization noise across time within each transform window — artifacts follow the signal's temporal envelope, masking distortion behind loud transients where the ear is least sensitive. TNS applies a linear prediction filter to the spectral coefficients before quantization, then inverts it during decode. The effect is subtle but measurable: on castanets and snare hits, TNS reduces audible pre-echo by 6–10 dB compared to a flat noise floor.

Container formats

Raw AAC bitstreams use ADTS (Audio Data Transport Stream) framing, where each frame carries its own header — simple but wasteful. For file storage and streaming, AAC wraps inside MP4 (M4A) using the ISO Base Media File Format. Apple's .m4a and .m4b (audiobook) extensions are MP4 containers holding AAC-LC. The MPEG-DASH and HLS streaming protocols also deliver AAC inside fragmented MP4 segments.

Profile Typical bitrate Frequency range Primary use
AAC-LC 128–256 kbps Full (20 Hz–20 kHz) Music streaming, video audio
HE-AAC v1 48–80 kbps Full via SBR Digital radio, podcasts
HE-AAC v2 24–48 kbps Full via SBR+PS Mobile streaming
xHE-AAC 12–500+ kbps Adaptive Voice + music mixed content

Decode performance

AAC-LC decode is lightweight: a modern smartphone processes stereo 256 kbps AAC in under 2% CPU utilization. Hardware decode is universal — every SoC from Apple's A-series to Qualcomm's Snapdragon includes a dedicated AAC DSP block. Software decode via libfdk-aac or Apple's AudioToolbox runs at roughly 80× real-time on a single core.

When to use AAC vs alternatives

AAC-LC at 128–192 kbps is the safe default for music distribution to Apple devices and web <audio> elements — Safari only added Opus support in 2023, and older iOS versions ignore it entirely. Opus outperforms AAC below 96 kbps and supports lower latency (5 ms vs 20 ms framing), making it better for VoIP and real-time communication. FLAC or ALAC serve lossless archival. Vorbis in Ogg is functionally equivalent to AAC at similar bitrates but has weaker hardware support.

Limitations

AAC's licensing situation is complex. Fraunhofer and Dolby hold essential patents; royalties apply to commercial encoder distribution (though not to end-user playback). The patent portfolio expires between 2028 and 2031 depending on jurisdiction. Maximum channel count in standard AAC-LC is 48 channels (7.1 + height channels for Atmos use the USAC profile). Gapless playback requires encoder-delay metadata in the MP4 container — many encoders write this incorrectly, causing audible clicks at track boundaries.

المرجع التقني

نوع MIME
audio/aac
Magic Bytes
FF F1 ADTS frame sync. Also FF F9 for CRC-protected frames.
المطوّر
ISO / Moving Picture Experts Group
سنة التقديم
1997
معيار مفتوح
نعم — عرض المواصفات
00000000FFF1 ..

ADTS frame sync. Also FF F9 for CRC-protected frames.

البنية الثنائية

Raw AAC files with .aac extension typically use ADTS (Audio Data Transport Stream) framing. Each ADTS frame begins with a 12-bit sync word (0xFFF), followed by header fields: MPEG version (1 bit: 0=MPEG-4, 1=MPEG-2), layer (always 0), protection absent flag (1 bit), profile (2 bits: 0=Main, 1=LC, 2=SSR, 3=LTP), sampling frequency index (4 bits), channel configuration (3 bits), and frame length (13 bits). The header is 7 bytes without CRC or 9 bytes with CRC. After the header, the raw AAC access unit follows, containing spectral data encoded via Modified Discrete Cosine Transform (MDCT) with Huffman coding. ADTS framing makes each frame independently decodable, enabling mid-stream joining and basic seeking. AAC in M4A/MP4 containers uses AudioSpecificConfig (ASC) in the esds box instead of per-frame ADTS headers, which is more efficient.

OffsetLengthFieldExampleDescription
0x00 12 bits Sync word FFF ADTS sync word. All 12 bits set to 1. Identifies the start of an ADTS frame.
bit 12 1 bit MPEG version 0 0 = MPEG-4, 1 = MPEG-2. Determines which AAC profiles are available.
bit 13 2 bits Layer 00 Always 00 for AAC. Non-zero values are reserved.
bit 15 1 bit Protection absent 1 1 = no CRC (7-byte header). 0 = CRC present (9-byte header with 16-bit CRC after header).
bit 16 2 bits Profile 01 AAC profile: 00=Main, 01=LC (Low Complexity, most common), 10=SSR, 11=LTP.
bit 18 4 bits Sampling frequency index 0100 Index into frequency table: 0=96kHz, 3=48kHz, 4=44.1kHz, 6=32kHz, 8=16kHz, 11=8kHz.
bit 30 3 bits Channel configuration 010 Channel count: 1=mono, 2=stereo, 6=5.1 surround, 7=7.1. Value 0 means channel config is in the bitstream.
bit 43 13 bits Frame length variable Total ADTS frame size in bytes including header. Used to locate the next frame in the stream.
1997AAC standardized as part of MPEG-2 (ISO/IEC 13818-7) by Fraunhofer IIS, Dolby, Sony, AT&T, and Nokia1999MPEG-4 Audio (ISO/IEC 14496-3) extends AAC with new profiles: AAC-LC, HE-AAC, AAC-LD2001Apple adopts AAC as the default codec for iTunes Store, driving mass consumer adoption2003HE-AAC (High Efficiency, using SBR) standardized for low-bitrate streaming and digital radio (DAB+)2006HE-AACv2 adds Parametric Stereo (PS) to SBR, enabling stereo audio at 24-32 kbps for mobile streaming2012xHE-AAC (Extended HE-AAC) standardized with USAC, unifying speech and audio coding for adaptive streaming
Transcode AAC to MP3 (high-quality VBR) ffmpeg
ffmpeg -i input.aac -c:a libmp3lame -q:a 2 output.mp3

-q:a 2 targets ~190kbps VBR with LAME encoder. This is a lossy-to-lossy transcode, so some generation loss is unavoidable. For speech content, -q:a 4 (~165kbps) is sufficient.

Decode AAC to uncompressed WAV ffmpeg
ffmpeg -i input.aac -c:a pcm_s16le output.wav

Decodes AAC to 16-bit signed little-endian PCM. The WAV output reflects the decoded audio at full sample rate. No data is added — this is a one-way decode, not a quality upgrade.

Wrap raw ADTS AAC in M4A container ffmpeg
ffmpeg -i input.aac -c:a copy output.m4a

-c:a copy performs stream copy — the AAC bitstream transfers into the M4A (MP4) container without re-encoding. Adds proper MP4 metadata atoms and seek table. Lossless operation.

Probe AAC file for profile and bitrate ffprobe
ffprobe -v error -show_streams -select_streams a:0 input.aac

Shows AAC profile (LC, HE, HEv2), sample rate, channel count, and bitrate. The profile field determines which decoder features are needed for correct playback.

AAC MP3 transcode lossy MP3 remains the most universally compatible audio format across all devices, car stereos, and legacy media players. Transcoding from AAC to MP3 is a generation loss operation, but at 192kbps+ VBR the difference is inaudible for typical content.
AAC WAV transcode lossless Decoding AAC to uncompressed PCM WAV provides a lossless intermediary for further editing in DAWs (Audacity, Pro Tools, Logic Pro). WAV files are universally accepted by audio editing software.
AAC OGG transcode lossy Vorbis in OGG is royalty-free and widely supported in open-source ecosystems, gaming engines (Unity, Godot), and Linux-based media players. Produces transparent quality at 160kbps+.
منخفض

نقاط الضعف

  • Malformed ADTS headers — crafted frame length fields can cause buffer over-reads in vulnerable decoders
  • Nested SBR/PS data — maliciously constructed HE-AAC bitstreams with invalid SBR parameters have triggered crashes in older decoders
  • ID3v2 tag injection — oversized or malformed ID3v2 tags prepended to ADTS streams can exploit tag parsers

الحماية: FileDex decodes AAC entirely in the browser sandbox using FFmpeg WASM. No server-side processing, no file upload. The WASM runtime enforces memory bounds and runs isolated from the host system.

FFmpeg أداة
Decodes and encodes all AAC profiles via internal decoder and libfdk-aac/native encoders
fdk-aac مكتبة
Fraunhofer FDK AAC codec library — high-quality AAC-LC/HE-AAC/HE-AACv2 encoder
FAAC/FAAD2 مكتبة
Open-source AAC encoder (FAAC) and decoder (FAAD2) for embedded and desktop applications
foobar2000 أداة
Windows audio player with AAC decoding, tagging, and format conversion capabilities
libavcodec (FFmpeg) مكتبة
Built-in AAC decoder and experimental encoder in FFmpeg, no external dependencies