Blog / Development

The Opus Codec: How CELT and SILK Became the Internet's Audio Standard

The Opus Codec: How CELT and SILK Became the Internet's Audio Standard

Before Opus, audio over the internet was fragmented. Voice calls used SILK or G.711. High-quality streaming used AAC or MP3. Real-time music required low-latency codecs nobody had agreed on. In September 2012, the IETF standardized RFC 6716, which collapsed those competing standards into a single codec by doing something nobody had tried before: putting two completely different audio codecs inside one, and switching between them dynamically.

That codec is Opus. It runs Discord, WebRTC, WhatsApp, Zoom, YouTube live streams, and Wwise game audio pipelines. Understanding how it works illuminates why audio quality in real-time applications is so much better than it was a decade ago, and why the "just use AAC" assumption is increasingly wrong.

Two Problems, Two Codecs

Speech and music are acoustically different in ways that matter for compression. Speech has long predictable runs, formant structure, pitch periodicity, and silence gaps between syllables. A codec that models those properties can compress speech very efficiently at low bitrates because it predicts rather than describes. Music has none of those properties. It is harmonically dense, unpredictable frame to frame, and rich in texture that cannot be modelled as a vocal tract.

Before Opus, engineers had to choose: use a speech codec (SILK, Speex, G.711) and suffer on music, or use a transform codec (AAC, Vorbis, CELT) and suffer on low-bitrate speech quality. Opus eliminates the choice.

SILK: Modelling the Vocal Tract

Skype developed SILK internally starting in 2007 and first deployed it in Skype 4.0 in February 2009. Its approach is Linear Predictive Coding (LPC). LPC treats the vocal tract as a time-varying filter: at any moment, a set of coefficients describes the resonant shape of the throat and mouth. The encoder transmits those coefficients plus a small residual signal representing what the filter did not predict. The decoder reconstructs speech by applying the filter to a synthesized excitation signal.

For speech at 6 to 40 kbps, this is extremely efficient. The vocal tract changes slowly, so the coefficients compress well. The residual is small because the prediction is accurate. For music, the prediction fails immediately: musical audio cannot be modelled as a vocal tract filter, so the residual grows large and the codec wastes bits on unpredictable content.

CELT: Bark Bands and Pyramid Vector Quantization

CELT (Constrained Energy Lapped Transform) was developed by Jean-Marc Valin at Xiph.org. Its primary goal was a transform codec with extremely low latency, targeting less than 10 ms where AAC-LD's minimum was around 20 ms.

CELT uses the Modified Discrete Cosine Transform (MDCT). It groups MDCT coefficients into bands that approximate the ear's critical bands on the Bark scale, the same perceptual frequency grouping that MP3's psychoacoustic model uses. Within each band, CELT quantizes spectral shape separately from energy.

The shape quantization uses Pyramid Vector Quantization (PVQ), a technique from the mid-1980s. PVQ represents a spectral shape as a point on the surface of an L1-norm ball. The encoder allocates a bit budget per band based on perceptual importance, then uses PVQ to find the best representation within that budget. The advantage: PVQ quality scales smoothly with available bits, so CELT degrades gracefully at low bitrates rather than producing hard artifacts.

At very low bitrates, CELT can apply a spreading step that redistributes sparse quantization pulses across a band, smearing them into the kind of diffuse noise the ear expects, rather than a few sharp spikes that cause the metallic swirling artifacts typical of overcompressed AAC.

Hybrid Mode: Running Both

Opus's key architectural insight is the hybrid mode, which runs SILK and CELT simultaneously on the same audio frame. SILK handles the speech-like content, and CELT adds a correction layer covering the spectral range SILK does not model well, typically 8 to 20 kHz. The decoder sums both outputs.

At low bitrates and for narrowband speech, Opus routes audio entirely through SILK. At high bitrates for music, it routes entirely through CELT. In between, the hybrid mode allocates bits between both encoders dynamically based on the audio content. The decoder does not need to determine which mode the encoder chose per-band: that decision is signaled in the packet header.

Frame sizes are configurable from 2.5 ms to 60 ms. Short frames reduce latency at the cost of compression efficiency. Long frames improve quality at the cost of latency. A 20 ms frame is typical for voice calls; 60 ms is used for high-quality music streaming where latency is less critical.

Performance Numbers

At 64 kbps stereo, Opus competes with AAC-LC at 96 kbps. The gap is largest at low bitrates: at 32 kbps, Opus speech sounds cleaner than AAC speech at the same bitrate. The gap narrows above 128 kbps, where both codecs approach transparency for most content.

Opus is royalty-free. AAC has licensing requirements that Fraunhofer enforces, which is one reason WebRTC standardized on Opus rather than AAC. The full bitrate range runs from 6 kbps narrowband mono to 510 kbps full-band stereo. At 256 kbps, Opus is perceptually transparent on essentially any music; the 510 kbps ceiling reflects protocol headroom rather than any practical encoding need.

Game Audio and Wwise

Wwise, the most widely used game audio middleware, includes Opus alongside ADPCM and Vorbis as codec options. Game audio has specific requirements: very low decode CPU cost, random seek capability, and predictable latency. Opus frames are self-contained, so random seek works. Decode complexity scales with bitrate and stays modest at typical game audio settings of 32 to 64 kbps per asset.

For interactive dialogue, the low-latency CELT mode matters: a 2.5 ms frame size means audio response is nearly instant. For compressed music beds and ambient loops, the high-bitrate CELT mode at 96 to 128 kbps delivers better quality per kilobyte than Vorbis on most content.

Machine Learning Additions in 1.5 and 1.6

Opus 1.5, released in March 2024, added deep learning at two points in the pipeline. Deep PLC (Packet Loss Concealment) replaces the previous hand-tuned heuristics with a neural network that predicts missing audio from context. When packets are lost, the traditional approach interpolated from the previous packet's properties; the neural approach uses learned priors about speech and music to generate plausible continuations, reducing audible disruption at packet loss rates that previously caused obvious degradation.

DRED (Deep Redundancy) embeds a compressed copy of previous audio in each packet. If a packet is lost, the receiver reconstructs the missing audio from redundant data in the next arriving packet. Unlike conventional Forward Error Correction, DRED uses a neural vocoder that compresses past audio heavily enough that embedding it adds only a small bitrate overhead.

Opus 1.6, released in December 2025, extended the maximum sample rate to 96 kHz via Opus HD, added a machine learning bandwidth extension module that reconstructs high-frequency content from lower-frequency predictions, and introduced a 24-bit encoder/decoder API. The Opus HD layer is backward compatible: a standard Opus decoder ignores the HD extension and decodes the base-layer signal normally, at bitrates up to 2 Mbps for the HD variant.

What This Means for Your Work

For audio engineers, Opus sets the quality baseline for anything distributed over the internet in real time. When a client mixes for a podcast, the streaming platform may transcode to Opus. When a game audio designer submits compressed assets for a WebRTC-based game, those assets may pass through Opus again. When a producer monitors a mix over a remote session tool, Opus is between the studio and the client's ears.

Understanding the bitrate-quality curve lets you set realistic targets. At 64 kbps, you are in competitive territory with AAC at 96 kbps. At 96 kbps stereo, Opus is clean on most mixed material. At 32 kbps, you will hear quantization artifacts on dense spectra but clarity on speech. Those are the real thresholds. They are not abstract bitrate numbers; they are the ceiling of what the codec's math can preserve.

The surprising thing about Opus is not its quality. It is that a royalty-free, openly developed codec, built by a nonprofit and a VoIP company, outcompeted a decade of proprietary standards and became the default audio transport for most real-time internet communication. That is a rare case where the open standard won on technical merit.