New accounts get up to $100 credit + a free number

Voice Codecs Explained: G.711, G.729, Opus, and HD Voice

A voice codec is the algorithm that converts speech into digital data for transmission over an IP network and back into sound at the other end. The name is short for coder-decoder. The codec decides three things that a caller actually notices: how clear the call sounds, how much bandwidth it uses, and how much delay it adds. G.711 is the uncompressed baseline used across the traditional phone network. G.729 compresses that audio to save bandwidth. Opus is a modern, royalty-free codec that adapts across a wide range of quality and bitrate. HD Voice is not a single codec but a label for wideband audio, delivered by codecs such as G.722 and AMR-WB that carry roughly twice the audio detail of the older narrowband codecs.

This article explains what a codec does, why sampling rate matters more than bitrate for perceived quality, and how the four common options compare so you can choose the right one for a business phone system, a contact center, a carrier interconnect, or a voice API integration.

Quick facts

Codec Standard Bitrate Audio band Best for
G.711 ITU-T G.711 (1972) 64 kbit/s, fixed Narrowband, about 300 to 3400 Hz Maximum interoperability, lowest processing delay
G.729 ITU-T G.729 8 kbit/s, fixed Narrowband, about 300 to 3400 Hz Saving bandwidth on constrained links
Opus IETF RFC 6716 (2012) 6 to 510 kbit/s, adaptive Narrowband up to fullband WebRTC, modern VoIP, variable networks
G.722 ITU-T G.722 (1988) 48, 56, or 64 kbit/s Wideband, about 50 to 7000 Hz HD Voice on enterprise SIP and desk phones
AMR-WB (G.722.2) ITU-T G.722.2 / 3GPP 6.6 to 23.85 kbit/s Wideband, about 50 to 7000 Hz Mobile HD Voice and VoLTE

What a voice codec actually does

Sound is an analog wave. An IP network moves digital packets. A codec bridges the two in a sequence that repeats continuously during a call.

At the sending end, the analog signal is sampled many thousands of times per second, and each sample is turned into a number. That step is pulse-code modulation (PCM), and it is the raw digital form of the audio. The codec then encodes those samples, either leaving them essentially as they are (G.711) or compressing them to use fewer bits (G.729, Opus, G.722). The encoded audio is packed into RTP packets and sent across the network. At the receiving end, the decoder reverses the process and reconstructs a sound wave.

Two properties of this process define a codec’s character. The first is the sampling rate, measured in kilohertz, which sets how much of the original sound can be represented at all. The second is the bitrate, measured in kilobits per second, which sets how much network capacity each second of audio consumes. A useful rule from sampling theory is that a digital signal can only represent frequencies up to half its sampling rate. An 8 kHz sampling rate can therefore carry audio up to about 4 kHz, which is why traditional phone calls sound slightly muffled: the higher frequencies that give speech its crispness are simply not captured.

Narrowband, wideband, and fullband

The single most important distinction between codecs is how much of the audio spectrum they carry, and that is set by the sampling rate rather than by the bitrate.

Narrowband codecs sample at 8 kHz and carry roughly 300 to 3400 Hz. This is the range the analog telephone network was built around, and it is enough to make speech intelligible. Wideband codecs sample at 16 kHz and carry roughly 50 to 7000 Hz, which captures the lower and higher tones that narrowband discards. The result is speech that sounds closer to being in the same room, with clearer consonants and easier speaker recognition. Fullband audio, which Opus can reach by sampling at 48 kHz, carries close to the full range of human hearing and is used where music or high-fidelity audio matters.


Caption: Narrowband codecs carry a narrow slice of the audio spectrum, while wideband and fullband codecs capture progressively more. The sampling rate sets the ceiling, because a call can only carry frequencies up to half its sampling rate.

HD Voice is the marketing term for wideband telephony. When a phone or service advertises HD Voice, it means the call is using a wideband codec such as G.722 on fixed and enterprise networks, or AMR-WB on mobile networks, rather than a narrowband codec. There is no separate “HD Voice codec”; the label describes the wider audio band those codecs deliver.

G.711: the interoperable baseline

G.711 is the oldest and most widely supported voice codec in use. Standardized by the ITU-T in 1972, it uses PCM at an 8 kHz sampling rate with 8 bits per sample, producing a fixed 64 kbit/s stream. It applies companding, a light form of logarithmic scaling, rather than true compression, which is why it is often described as uncompressed.

G.711 comes in two variants that are not interchangeable on the wire: A-law, used across most of the world, and μ-law (mu-law), used primarily in North America and Japan. In RTP these appear as the PCMA and PCMU payload formats.

Its strengths are interoperability and low delay. Because it does almost no signal processing, its algorithmic delay is negligible, and because nearly every device and gateway supports it, it is the safe fallback in almost any call. Its patents expired long ago, so it carries no licensing cost. The tradeoff is bandwidth: at 64 kbit/s before IP overhead, it uses far more than compressed narrowband codecs. It is a good default when bandwidth is plentiful and interoperability matters most, and it is the reference codec against which others are compared.

G.729: narrowband audio at low bandwidth

G.729 solves the bandwidth problem that G.711 creates. It uses a technique called CS-ACELP (conjugate-structure algebraic code-excited linear prediction), which models the human vocal tract to reconstruct speech from a compact set of parameters rather than transmitting the waveform directly. This compresses narrowband audio to just 8 kbit/s, about one eighth of G.711.

That efficiency has costs. G.729 processes audio in 10 ms frames and uses a 5 ms look-ahead, giving an algorithmic delay of about 15 ms before any network delay is added. The heavier processing means more computation per call. Its aggressive compression is tuned for speech, so it handles non-speech signals poorly: fax tones and reliable in-band DTMF (touch-tone) digits do not survive it well, which is why DTMF is usually carried as separate named telephone events rather than as audio. Historically, G.729 also carried patent licensing obligations, though its core patents have since expired.

G.729 makes sense where many concurrent calls share a constrained link and bandwidth is the binding constraint. Where bandwidth is not scarce, newer codecs offer better quality for similar or lower cost.

Opus: one codec across the whole range

Opus is a modern codec standardized by the IETF as RFC 6716 in 2012, and it is royalty-free. It was built by combining two designs: SILK, a linear-prediction coder well suited to speech, contributed from Skype, and CELT, a transform coder well suited to music and very low delay, from the Xiph.Org Foundation. Opus can use either or blend both in a hybrid mode.

What sets Opus apart is range. A single codec scales from 6 kbit/s narrowband speech up to 510 kbit/s high-quality stereo, and it can operate at sampling rates from 8 kHz up to 48 kHz, covering narrowband through fullband. It supports variable bitrate, adjusting quality frame by frame as network conditions change, and its frame sizes can be as short as 2.5 ms for low-latency use, though around 20 ms is typical for calls. It also includes built-in tools for handling packet loss.

Because of this flexibility, Opus is the default audio codec for WebRTC, the technology behind in-browser calling, and browsers implementing WebRTC are required to support both Opus and G.711. The main consideration is that Opus is more computationally demanding than G.711, and it is still less universally present on legacy telephone equipment, so calls that touch the traditional phone network often fall back to a narrowband codec at the boundary. For modern IP-to-IP voice on variable networks, Opus is usually the strongest choice.

HD Voice: G.722 and AMR-WB

HD Voice describes wideband calling, and two codecs deliver most of it.

G.722, standardized by the ITU-T in 1988, samples at 16 kHz and carries roughly 50 to 7000 Hz using sub-band ADPCM. A notable property is that its common 64 kbit/s mode uses the same wire bandwidth as G.711 while delivering wideband audio, which is why many enterprise SIP deployments and desk phones adopt it as their HD default without renegotiating bandwidth budgets. It also offers 48 and 56 kbit/s modes, and its patents have expired.

AMR-WB, standardized as ITU-T G.722.2 and adopted by 3GPP, is the wideband codec behind HD Voice on mobile networks and in VoLTE. It covers the same roughly 50 to 7000 Hz band but is optimized for mobile efficiency, operating at rates from 6.6 to 23.85 kbit/s and adapting to radio conditions. This lets carriers deliver wideband quality within tight mobile bandwidth.

Both give the clearer, more natural sound that distinguishes an HD call from a standard one. The practical catch is that HD Voice only works end to end when every hop supports the same wideband codec. If any segment forces a narrowband codec, the call drops to narrowband quality for everyone on it.

How codecs get chosen: negotiation and transcoding

Endpoints do not have a codec imposed on them; they negotiate one at the start of the call. During SIP call setup, each side advertises the codecs it supports in order of preference, and they agree on the highest-preference codec both share. This is why keeping a common codec available on both ends matters so much.


Caption: When both endpoints share a codec, media flows directly. When they share none, a gateway must transcode between them, which adds delay and can reduce quality.

When two endpoints share no common codec, something in the middle has to translate. That is transcoding: a gateway decodes the audio from one codec and re-encodes it into another. Transcoding works, but it is costly. Each decode-and-re-encode step adds processing delay to the audio path, and re-encoding audio that has already been compressed discards detail that cannot be recovered, so quality drops. Passing a call through with a shared codec, sometimes called a transcoding-free path, avoids both penalties. This is a practical reason to prefer a widely supported codec such as G.711 for interconnects, and to make sure a wideband codec is offered on both ends when HD Voice is the goal.

Codec comparison

Property G.711 G.729 Opus G.722 (HD) AMR-WB (HD)
Audio band Narrowband Narrowband NB to fullband Wideband Wideband
Sampling rate 8 kHz 8 kHz 8 to 48 kHz 16 kHz 16 kHz
Bitrate 64 kbit/s 8 kbit/s 6 to 510 kbit/s 48 to 64 kbit/s 6.6 to 23.85 kbit/s
Bitrate type Fixed Fixed Adaptive (VBR or CBR) Fixed per mode Adaptive
Added processing delay Very low Moderate Low to moderate Low Moderate
Licensing Patents expired Core patents expired Royalty-free Patents expired Historically licensed
Typical use PSTN, universal fallback Bandwidth-constrained links WebRTC, modern VoIP Enterprise HD phones Mobile HD Voice, VoLTE

How to choose a codec

The right codec depends on what constrains your deployment.

Choose G.711 when interoperability and simplicity matter most, when bandwidth is not scarce, or when you need a reliable fallback that every device understands. Choose G.729 only when you are genuinely bandwidth-constrained across many concurrent narrowband calls and cannot use a more modern codec. Choose Opus for IP-to-IP voice on modern platforms, browser-based calling, and networks where conditions vary, because its adaptability and quality-per-bit are strong and it is royalty-free. Choose a wideband codec, G.722 on fixed and enterprise SIP or AMR-WB on mobile, whenever call clarity is a priority and you can ensure wideband support end to end.

A few practical rules apply across all of these. Match the codec to the whole path, not just your own endpoint, because the weakest hop sets the outcome. Avoid unnecessary transcoding by keeping at least one common codec on both sides. And weigh sampling rate ahead of bitrate when clarity is the objective, since a wideband codec at a modest bitrate usually sounds better than a narrowband codec at a high one.

Common mistakes

  • Treating bitrate as a proxy for quality. A higher bitrate does not help if the codec is narrowband. Sampling rate sets the audio ceiling; bitrate only sets how efficiently that band is carried.
  • Expecting HD Voice from one HD endpoint. Wideband quality requires wideband support on every hop. A single narrowband segment collapses the whole call to narrowband.
  • Leaving heavy transcoding in the path. Chained decode-and-re-encode steps quietly add delay and erode quality. Audit which codec is actually used end to end, not just what each side offers.
  • Assuming DTMF survives compression. Low-bitrate codecs such as G.729 distort in-band tones. Carry DTMF as separate telephone events instead of relying on the audio channel.
  • Overlooking licensing. Some codecs have carried patent obligations. Confirm the current status for your deployment rather than assuming, and note that G.711, G.722, and Opus are freely usable today.

Where didlogic fits

Codecs live at the media layer of a voice call, and that is the layer didlogic operates. As a voice infrastructure provider, didlogic supplies DID numbers, SIP trunking, and carrier routing, and it handles codec negotiation between your platform and the phone network as calls are set up and delivered.

In practice this means didlogic supports G.711 for a widely interoperable, transcoding-free path into and out of the traditional phone network, and G.722 for wideband HD Voice where both ends support it. That matters for use cases where audio clarity affects outcomes, including contact centers, where wideband improves intelligibility on long calls, and voice API and AI voice integrations, where cleaner input audio helps speech recognition accuracy. The codec your endpoints and platform support, together with the codec available across the carrier path, determines what quality a call can actually reach; didlogic provides the carrier-side leg of that path. You can read more about how these layers connect on the didlogic SIP trunking for developers page and the AI voice infrastructure page.

Frequently asked questions

Is a higher bitrate always better quality?
No. Bitrate controls how efficiently the captured audio is carried, but the sampling rate sets how much audio is captured in the first place. A wideband codec at a moderate bitrate generally sounds clearer than a narrowband codec at a high bitrate, because the narrowband codec never captured the higher frequencies.

What is the difference between HD Voice and a normal call?
HD Voice means the call uses a wideband codec, so it carries roughly 50 to 7000 Hz instead of the narrowband 300 to 3400 Hz. The extra range makes speech sound fuller and clearer. HD Voice is a description of wideband audio, not a specific codec; G.722 and AMR-WB are the codecs that commonly deliver it.

Which codec should I use for a browser-based or WebRTC application?
Opus is the default and usually the best choice for WebRTC, and browsers implementing WebRTC are required to support it alongside G.711. Opus adapts well to changing network conditions and covers narrowband through fullband in a single codec.

Why do my HD phones sometimes drop to standard quality?
Wideband audio only survives if every segment of the call supports the same wideband codec. If any hop, such as a leg over the traditional phone network, forces a narrowband codec, the whole call falls back to narrowband. Ensuring wideband support end to end is the fix.

Does compressing audio with G.729 or Opus add delay?
Compressed codecs add some processing delay because they analyze audio in frames. G.729 adds around 15 ms of algorithmic delay; Opus is configurable and can be very low. G.711 adds almost none. Whether that delay matters depends on the total end-to-end budget for the call.

What is transcoding and why avoid it?
Transcoding is converting audio from one codec to another mid-call, which is required when two endpoints share no common codec. It adds processing delay and reduces quality because re-encoding compressed audio loses detail. Keeping a shared codec on both ends avoids it.

Continue learning

CREATE ACCOUNT

Free trial is available for IT infrastructure managers and developers.