Back to Blog
Technical7 August 20269 min read

Codecs Demystified: Why G.711 Still Rules the Phone World

From 64 kbps PCM to Opus at 6 kbps — everything about audio codecs in Voice AI.

Abstract teal and gold waveform compression visualization with binary data

A codec (coder-decoder) is an algorithm that compresses audio data for efficient transmission and decompresses it for playback. In the world of Voice AI, codecs are omnipresent but largely invisible — until something goes wrong. A poorly negotiated codec can turn a crisp AI voice into muffled, robotic-sounding audio. An unnecessary transcoding step can add 100 ms of latency and compound audio artifacts. Understanding codecs from first principles is not optional knowledge for serious Voice AI engineers — it is foundational.

The codec decisions your system makes happen at the SDP negotiation stage of every SIP call, often within the first 200 ms before any audio has been exchanged. These decisions cascade through the entire audio path: they determine the bandwidth your media server consumes, the CPU cycles spent encoding and decoding, and critically, the frequency content that reaches your ASR engine. A mistake here is embedded in every single audio frame of every call.

Why Compression Exists: The Raw Numbers

Raw uncompressed audio in PCM (Pulse Code Modulation) format at telephone quality — 8 kHz sample rate, 16-bit samples — requires 128 kbps of bandwidth. Wideband audio at 16 kHz requires 256 kbps. For a 1-minute call that is approximately 2 MB of data at narrowband and 4 MB at wideband. Multiply by millions of concurrent calls on the global telephone network and you understand immediately why compression exists.

Audio codecs exploit two types of redundancy in speech signals. Temporal redundancy: adjacent audio samples are highly correlated, so you can predict the next sample from the previous few and encode only the prediction error. Psychoacoustic redundancy: the human auditory system has limited resolution in certain frequency bands and at certain amplitude levels, so you can discard information the ear cannot detect anyway. Different codecs strike different tradeoffs between compression ratio, perceptual quality, computational complexity, and encoding delay.

G.711: The Indestructible Grandfather

G.711 is an ITU standard from 1972 that compresses PCM audio to 64 kbps using logarithmic companding — a technique that gives more quantization levels to quiet sounds, where the human ear is more sensitive, and fewer levels to loud sounds. It comes in two variants: mu-law (used in North America and Japan) and A-law (used in Europe, India, and most of the rest of the world). Both achieve the same 2:1 compression ratio from 128 kbps PCM to 64 kbps G.711.

G.711 dominates PSTN telephony for three reasons: it is mandated by the ITU as the reference codec for circuit-switched voice networks, it has essentially zero encoding latency (it is implemented as a lookup table operation, not a complex algorithm), and it introduces no perceptible quality degradation relative to raw 8 kHz PCM. Every SIP phone, every VoIP gateway, every PBX ever built supports G.711. It is the TCP/IP of voice codecs — simple, ubiquitous, and good enough for its intended purpose.

Fun Fact

G.711 has been in continuous use for over 50 years and remains the dominant codec on the global telephone network. When your Cirio AI agent talks to a customer's landline, it is almost certainly using G.711 A-law for the audio encoding.

G.722: The HD Voice Upgrade

G.722 doubles the audio bandwidth to 16 kHz — covering 50 Hz to 7,000 Hz instead of G.711's 300 Hz to 3,400 Hz — at the same or slightly lower bitrate of 48 to 64 kbps. The perceptual improvement is immediately obvious: consonants are sharper and more distinctive, voices are easier to tell apart, and background noise is easier to separate from the foreground speech. This matters enormously for ASR accuracy.

Modern 4G VoLTE calls between two smartphones often use G.722 or its successor EVS (Enhanced Voice Services), which is why mobile-to-mobile calls sound dramatically better than mobile-to-landline calls — the landline end forces a downgrade to G.711 at the PSTN interconnect. For AI voice agents making or receiving VoLTE calls, detecting and preferring G.722 in SDP negotiation can improve transcription accuracy by 8 to 15% according to Cirio's internal benchmarks.

Opus: The Modern Internet Standard

Opus (RFC 6716) was developed by Xiph.org and standardized by the IETF in 2012. It is the default codec in WebRTC and the best choice for browser-based Voice AI applications. Opus is remarkable in its range: it covers 6 kbps (low-bitrate narrowband, still better than G.729) all the way to 510 kbps (lossless-quality wideband audio), adapts dynamically to changing network conditions, handles both speech and music gracefully, and has an algorithmic latency of just 2.5 ms. Unlike G.729, Opus is royalty-free.

  • G.711 mu/A-law: 64 kbps, 8 kHz — PSTN standard, zero latency, universal support
  • G.722: 48-64 kbps, 16 kHz — HD Voice, VoLTE, major ASR accuracy boost
  • G.729: 8 kbps, 8 kHz — Low bandwidth but 10ms codec delay, licensed patent
  • Opus: 6-510 kbps, up to 48 kHz — WebRTC standard, royalty-free, adaptive
  • EVS: 5.9-128 kbps, up to 32 kHz — 5G and VoLTE, super-wideband quality
  • AMR-WB: 6.6-23.85 kbps, 16 kHz — Common on 3G/4G mobile calls in India

Transcoding: The Silent Quality Killer

Transcoding happens when audio is converted from one codec to another mid-call. Each transcode is a lossy decode-then-encode cycle: you decompress the audio back to PCM, then recompress it with a different algorithm. Each step introduces the compression artifacts of that codec. A call that travels: caller phone G.711, CPaaS internal Opus, your media server G.711, your ASR engine PCM has been transcoded three times. Quality degrades at each step, and 10 to 20 ms of latency is added per transcode.

The best Voice AI architectures minimize transcoding by negotiating a single codec end-to-end and performing exactly one final decode to PCM for the ASR engine. If your CPaaS delivers G.711 audio, pass G.711 directly to your ASR rather than converting to Opus first. This is a simple optimization that many early Voice AI implementations miss, often because the default CPaaS SDK configuration introduces unnecessary codec conversions.

Codecs and Rural India

For Voice AI targeting Indian SMBs — many of which are located in areas with congested 3G networks or intermittent 4G coverage — codec choice has real business consequences. A G.711 stream at 64 kbps is more susceptible to packet loss than a G.729 stream at 8 kbps on a congested link. Opus at 12 to 16 kbps provides an excellent middle ground for internet telephony: low bandwidth, graceful packet loss concealment built in, no licensing costs. For businesses operating voice agents that need to reach customers in Tier-2 and Tier-3 cities, testing your audio quality specifically on 3G-class connections is not optional — it is where real users are.