DEV Community

Denny Guide
Denny Guide

Posted on Edited on

WAV vs MP3 vs FLAC vs AAC: I Round-Tripped 60 Seconds of Audio and Measured the Damage

A client sent me a 90 MB WAV demo last month and asked me to "shrink it
but keep the quality." Which is the audio equivalent of "make it pop" —
everyone nods, nobody knows which knob to turn. MP3? FLAC? AAC? At what
bitrate? The advice you find online is mostly folklore, so I did what I
usually do: I built a benchmark and measured what actually survives.

The setup

I synthesized a 60-second reference track at 48 kHz / 16-bit stereo — a
chord progression with decaying harmonics, a bass line, and hi-hat noise
bursts every quarter beat. Synthetic, yes, but deliberately: it has the
two things that stress lossy encoders (broadband harmonics and sharp
transients), and because I generated it, I have the exact ground truth —
no hand-labeling, no "sounds fine to me."

Then I converted it through the format matrix with ffmpeg 8.0, decoded
everything back to PCM, aligned it against the reference with
cross-correlation (lossy codecs add encoder delay — comparing without
aligning is how people get garbage SNR numbers), and computed
signal-to-noise ratio over the middle 59 seconds.

The reference WAV: 11,520,044 bytes (1,536 kbps).

Round 1: the lossy ladder

Conversion Size vs WAV SNR vs original
WAV → MP3 128k 961 KB 8% 24.4 dB
WAV → MP3 192k 1.4 MB 13% 28.6 dB
WAV → MP3 320k 2.4 MB 21% 36.1 dB
WAV → AAC 128k 1.0 MB 9% 27.5 dB
WAV → AAC 256k 2.0 MB 17% 30.7 dB

Two honest observations. AAC at 128k lands where MP3 lands at 192k —
same ballpark of fidelity at two-thirds the bits, which matches the
conventional wisdom for once. And MP3 at 320k was the most transparent
of the lossy lot on this track: 36 dB of SNR at 21% of the size. None
of these numbers mean "identical" — they mean "how much of the original
got thrown away, in dB."

Round 2: the lossless baseline

WAV → FLAC (level 8): 3.6 MB — 31% of the WAV — and bit-exact. I
verified it the boring way: decoded the FLAC back to PCM, md5'd the
samples, md5'd the reference. Identical. That's the whole point of
lossless: the size drops, not a single sample changes. (One caveat: this
synthetic track compresses unusually well because sine-based content is
predictable. Real catalog music typically lands at 50–70% of WAV — still
the best archival ratio you'll get without losing anything.)

Round 3: the two myths

Myth 1: "Convert MP3 to FLAC to get the quality back." I took the
320k MP3 and converted it to FLAC:

Path Size SNR
WAV → MP3 320k 2.4 MB 36.1 dB
WAV → MP3 320k → FLAC 9.0 MB 36.1 dB

The SNR did not move. It can't — the information MP3 threw away is
gone; FLAC faithfully preserves what's left, which is an already-damaged
signal. You paid 3.7× the file size for zero recovery. The only
legitimate reason to do this is compatibility with a player that won't
touch MP3.

Myth 2: "Re-encoding is fine as long as the bitrate is high." I took
the 256k AAC and converted it to 320k MP3:

Path SNR
WAV → MP3 320k (direct) 36.1 dB
WAV → AAC 256k → MP3 320k 29.7 dB

Two lossy steps cost 6.4 dB versus one — even though the second step was
at a higher bitrate than the first. Every lossy hop subtracts; a high
bitrate only makes the subtraction smaller, never negative. The rule
that falls out: keep a lossless master (FLAC or the original WAV), and
derive every lossy copy from it, never from another lossy copy.

The decision table I actually use

  • Archiving / stems / anything you'll re-edit later: FLAC. Bit-exact, ~30–70% of WAV.
  • Sending a demo / sharing / "just make it smaller": MP3 320k (max compatibility) or AAC 256k (slightly smaller, fine for Apple-ecosystem recipients).
  • Email limits / voice memos: AAC 128k. Roughly MP3-192 quality at 128k bits.
  • Never: lossy → lossless "upgrades," or chains of lossy → lossy.

The commands, if you want to run your own:

# lossless archive
ffmpeg -i input.wav -c:a flac -compression_level 8 out.flac
# transparent-ish lossy
ffmpeg -i input.wav -c:a libmp3lame -b:a 320k out.mp3
# small + decent
ffmpeg -i input.wav -c:a aac -b:a 128k out.m4a
Enter fullscreen mode Exit fullscreen mode

And when I just need one conversion on a machine without ffmpeg — or
the format pair is exotic (wav↔m4a, opus or amr to mp3, pulling m4a out
of an mp4) — I use a browser converter instead of installing anything:
I Love Convert's mp3 to wav tool
handles the common matrix, and the same site covers the odd corners
like amr-to-mp3 and mp4-to-m4a that desktop players tend to choke on.

Benchmark script is ~120 lines of numpy + ffmpeg subprocess calls;
happy to share if anyone wants to run it on their own reference track —
the numbers above are only gospel for content shaped like mine.

Top comments (0)