
Audio codecs explained: PCM, MP3, Opus, FLAC and neural compression
Stereo CD PCM uses 1,411.2 kbps; the original Lyra speech codec uses 3 kbps. The numbers differ by about 470 times, but that does not mean CD music can be compressed to 1/470 of its size at the same quality. The source material, bandwidth, channel count and evaluation conditions differ. This article explains what codecs preserve and what they approximate, moving from PCM to perceptual coding, lossless compression and neural coding.
Japanese original published: 2026-05-13
PCM: sample rate, bit depth and channel count
Pulse Code Modulation represents amplitude measurements taken at successive times as numbers. CD linear PCM uses 44,100 samples per second, 16 bits per sample and two channels: 44,100 × 16 × 2 = 1,411,200 bit/s. These are quantized digital samples, not a recording of the original analog waveform at unlimited precision.
One minute of audio data therefore takes 1,411,200 × 60 ÷ 8 = 10,584,000 bytes, or 10.584 MB in decimal units. Headers are excluded. Audio CDs and data CDs use their sectors differently, so a data CD’s “650 MB” capacity should not be inserted directly into this calculation to explain audio playing time.
Telephone G.711 uses 8,000 samples per second and an eight-bit codeword for each sample, giving 64 kbps. Its A-law or μ-law nonlinear quantization differs from 16-bit linear PCM, as does the audio bandwidth it serves. The term PCM alone does not specify quality or data size.
MP3: lossy coding informed by human hearing
MP3 derives its name from MPEG-1 Audio Layer III. ISO/IEC 11172-3 was published in 1993, and an internal Fraunhofer IIS poll selected the “.mp3” extension on July 14, 1995. Research by Karlheinz Brandenburg and others, including listening tests with the demanding a cappella recording of Suzanne Vega’s “Tom’s Diner,” forms part of this history. It was not the work of one person alone.
An encoder analyzes audio using a filter bank and transforms such as the MDCT, then allocates bits and controls quantization error with auditory masking in mind. This is more than simply deleting sounds that cannot be heard: it is a way to make coding errors less noticeable within a limited bit budget.
A 128 kbps stream uses roughly one-eleventh the bitrate of 1,411.2 kbps PCM. That is a rate ratio, not a guarantee of transparent CD quality. Results depend on the encoder, settings, material and listening conditions.
AAC: distinguish the profiles
Advanced Audio Coding is a family of audio coding technologies standardized by MPEG. There is no universal conversion such as “AAC at 128 kbps equals MP3 at 192 kbps.” Comparisons need to identify the profile, encoder, settings and source material, not just the format name.
Scroll horizontally if the table does not fit.
| Name | Main idea |
|---|---|
| AAC-LC | Low Complexity: a widely used AAC configuration |
| HE-AAC | Combines AAC with Spectral Band Replication (SBR) |
| HE-AAC v2 | Also uses parametric stereo |
| xHE-AAC | Based on USAC and designed to handle speech and music, including at low bitrates |
Table source: Via Licensing Alliance: Advanced Audio Coding (AAC). This summarizes features, not a quality ranking.
Efficient representations of high-frequency or stereo information do not make low-bitrate output unconditionally identical to the source. Decoder and destination compatibility still matter. Patent licensing and software permissions are addressed separately below.
Vorbis: a codec is not a container
Xiph.Org’s Vorbis is a general-purpose lossy audio codec with a public specification. Like MP3, it uses transform coding and auditory considerations to preserve perceived quality within a limited data budget.
Vorbis is a codec; Ogg is a container. An Ogg file need not contain Vorbis: it can carry Opus, for example. Likewise, the names WebM and MP4 alone do not identify the audio codec inside.
It is not useful to rank Vorbis permanently above MP3 and below AAC. The project describes a freely implementable format, but the license of the software you actually distribute must also be checked.
Opus: speech, music and low-delay operation
Defined in RFC 6716 in September 2012, Opus combines a SILK-derived predictive coding approach with a CELT-derived MDCT approach. It provides SILK-only, hybrid and CELT-only modes, used according to configuration and bandwidth. Not every packet uses both approaches.
Scroll horizontally if the table does not fit.
| Item | How to interpret it |
|---|---|
| Bitrate | The RFC covers 6–510 kbps; this is not a quality guarantee |
| Frame duration | 2.5, 5, 10, 20, 40 or 60 ms; available durations depend on the mode |
| Delay | Lookahead, processing, networking and playback buffering add to frame duration |
| Loss resilience | Features such as in-band FEC in applicable modes mitigate loss; they do not guarantee perfect recovery |
Table source: IETF Datatracker: RFC 6716 - Definition of the Opus Audio Codec. End-to-end delay also depends on networking and playback conditions.
A minimum frame duration or algorithmic delay is not the end-to-end delay of a call. RFC 7874 requires WebRTC endpoints to implement Opus and G.711 PCMA/PCMU. Opus is not the only mandatory audio codec.
The official comparison page includes listening-test results and an overview graph that also uses anecdotal evidence where data is unavailable. It warns against reading exact values at a particular bitrate from that graph. It does not establish a universal conversion such as “Opus 64 kbps equals MP3 128 kbps,” or prove that one codec is best for every application.
FLAC: preserve digital audio samples losslessly
The Free Lossless Audio Codec reconstructs its input PCM samples exactly. It exploits regularities in audio, for example by efficiently coding the difference between predicted and actual samples. The format is now also defined in RFC 9639.
“Not losing a bit” refers to the audio samples. It does not promise identical metadata, chunk order or every byte of the original WAV file. Converting an MP3 file to FLAC also cannot restore information already lost during MP3 encoding.
The compressed size depends on the source and settings. Silence and noise have different predictability, so output is not guaranteed to be 50–70% of the original size. For archives or further editing, losslessness is a separate consideration from storage size.
Neural codecs: Lyra, SoundStream and EnCodec
A learned encoder maps a waveform to a compact representation; a decoder reconstructs audio from the quantized information. SoundStream’s residual vector quantization (RVQ) uses multiple codebooks, with later stages representing errors left by earlier ones. This is not lossless restoration of the input PCM.
Keep Lyra and SoundStream distinct
The original Lyra described by Google in 2021 was a 3 kbps codec for speech communication. It did not use the same model as the later SoundStream system. Lyra V2, announced in 2022, is based on SoundStream and supports 3.2, 6 and 9.2 kbps. A table labeling V2 as 3 kbps is inaccurate.
The SoundStream announcement reports a test in which 3 kbps exceeded Opus at 12 kbps. This is a result for the models, data and evaluation conditions used at that time, not proof of CD-quality stereo music at 3 kbps. Training and inference costs also differ: neural coding does not automatically mean a GPU is required.
EnCodec model conditions
The 2022 EnCodec paper covers a 24 kHz mono configuration and a 48 kHz stereo configuration. Do not combine low-bitrate options into one range and assume every model supports the same conditions. Additional language-model compression is a further coding stage applied to the learned representation. The paper’s “up to 40%” result is not a constant saving.
Approximating the input can introduce distortions in voices or background sounds. Evaluate bandwidth savings alongside intelligibility, music reproduction and execution time using material relevant to the intended application.
Calculate one minute of data—not equivalent quality
The following calculations cover audio payload only, assuming a constant or average bitrate. Here, 1 kbps = 1,000 bit/s, 1 kB = 1,000 bytes and 1 MB = 1,000,000 bytes. Size = bitrate × 60 seconds ÷ 8. Container overhead, metadata, packet headers, retransmissions and model distribution are excluded.
Scroll horizontally if the table does not fit.
| Format or example setting | kbps | Payload for 60 seconds |
|---|---|---|
| CD linear PCM, stereo | 1,411.2 | 10.584 MB |
| G.711, mono | 64 | 0.480 MB |
| MP3 example setting | 320 | 2.400 MB |
| AAC example setting | 256 | 1.920 MB |
| MP3 example setting | 128 | 0.960 MB |
| Opus example setting | 96 | 0.720 MB |
| Opus example setting | 32 | 0.240 MB |
| Lyra V1, speech | 3 | 22.5 kB |
| Lyra V2, speech | 3.2 | 24.0 kB |
Table calculations: NanToo Editorial Team, using the 60-second, decimal-unit, payload-only formula above. Lyra settings are from Google Research: Lyra: A New Very Low-Bitrate Codec for Speech Compression and Google Open Source Blog: Lyra V2 - a better, faster, and more versatile speech codec.
Equal duration does not mean equal bandwidth, channel count or source material. This is not a quality ranking. FLAC has no fixed average bitrate for arbitrary input, so measure the encoded result. With variable-bitrate encoding, the configured value and measured average may also differ.
MediaRecorder: detect formats instead of guessing by browser
MediaRecorder records a MediaStream. Containers such as WebM or MP4 and codecs such as Opus or AAC are separate choices. Support depends on the operating system, browser and version.
Safari is not restricted to AAC. WebKit announced support for creating WebM with Opus through MediaRecorder in Safari 18.4. An old compatibility table should not be applied to every current environment.
- Check that MediaRecorder exists.
- Check candidate formats with a call such as
MediaRecorder.isTypeSupported("audio/webm;codecs=opus"). - Handle recording failures even when the support check returns true; insufficient resources are one possible cause.
- Inspect
recorder.mimeTypeand the output, then choose an appropriate file extension and playback environment.
NanToo’s voice recorder (Japanese) selects supported candidates and displays a format label derived from the recorded output’s MIME type in its recording list.
Licensing and selection: separate specifications, code and models
A public codec specification, permission to use implementation code, patent licenses and the terms for trained models are different things.
Scroll horizontally if the table does not fit.
| Technology | What to check |
|---|---|
| MP3 | The Fraunhofer/Technicolor licensing program ended on April 23, 2017. This did not remove copyright from every implementation |
| AAC | Relevant patents, territories and contract terms from Via LA; do not assume a universal 2028 or 2031 expiry |
| Vorbis / FLAC | The public specification and the license of the implementation you use |
| Opus | Distinguish the reference implementation’s BSD terms from the separate patent license statements |
| Lyra | Apache 2.0 terms in the official repository |
| EnCodec | The official repository identifies the code as MIT-licensed; check the terms of models and other distributed assets separately |
Table sources: Fraunhofer IIS: mp3 / Via Licensing Alliance: Advanced Audio Coding (AAC) / Opus Codec: License – Opus Codec / GitHub / google: A Very Low-Bitrate Codec for Speech Compression / GitHub / facebookresearch: EnCodec: High Fidelity Neural Audio Compression. These are checks for distinct distributed assets and licensing terms.
Browsers already have lower-level WebCodecs interfaces such as AudioEncoder and AudioDecoder. API availability alone does not establish support for a particular codec, and packaging the output in a container is a separate task. These interfaces do not automatically replace MediaRecorder with a simple save-any-format operation.
Start with the requirement: losslessness for preservation, delay and loss resilience for calls, or playback compatibility and size for distribution. Then compare the same input under the same evaluation conditions, rather than choosing by bitrate alone.
References and sources
- IETF Datatracker: RFC 6716 - Definition of the Opus Audio Codec ↗
- ISO: ISO/IEC 11172-3:1993 — Information technology — Coding of moving pictures and associated audio for digital storage media at up to about 1,5 Mbit/s — Part 3: Audio ↗
- www.iis.fraunhofer.de: 30 Years of .mp3: Three Letters That Changed the World ↗
- Google Research: SoundStream: An End-to-End Neural Audio Codec ↗
- arXiv: [2210.13438] High Fidelity Neural Audio Compression ↗
- www.opus-codec.org: Comparison – Opus Codec ↗
- MDN Web Docs: MediaRecorder - Web API ↗
- ITU: G.711 : Pulse code modulation (PCM) of voice frequencies ↗
- RFC Editor: RFC 7874 — WebRTC Audio Codec and Processing Requirements ↗
- RFC Editor: RFC 9639 — Free Lossless Audio Codec (FLAC) ↗
- Xiph.Org Foundation: Vorbis I specification ↗
- Opus Codec: License – Opus Codec ↗
- Fraunhofer IIS: mp3 ↗
- Via Licensing Alliance: Advanced Audio Coding (AAC) ↗
- Google Research: Lyra: A New Very Low-Bitrate Codec for Speech Compression ↗
- Google Open Source Blog: Lyra V2 - a better, faster, and more versatile speech codec ↗
- GitHub / google: A Very Low-Bitrate Codec for Speech Compression ↗
- GitHub / facebookresearch: EnCodec: High Fidelity Neural Audio Compression ↗
- WebKit: WebKit Features in Safari 18.4 ↗
- MDN Web Docs: MediaRecorder: isTypeSupported() static method - Web APIs ↗
- W3C: WebCodecs ↗
- Sony: Volume 2 Chapter 7 Digitizing Music ↗
Editorial note
This article was prepared with AI assistance and reviewed by an editor before publication. It may still contain factual errors, interpretation mistakes, or outdated information. Check the cited primary sources or official documentation before making an important decision.

