GSMCalls
Standards6 min readUpdated

G.711 A-law vs µ-law (and When to Use G.729, G.722 or Opus)

By GSMCalls Engineering

G.711 A-law and µ-law are two versions of the same ITU-T codec: both sample speech 8,000 times a second with 8 bits per sample, giving 64 kbit/s. They differ only in the companding curve. µ-law is used in North America and Japan; A-law is used in Europe and most of the rest of the world.

Choosing a codec is one of the few settings that affects every call on a trunk. This article explains how G.711 works, why the two variants exist, how codecs are negotiated in SIP, and when G.729, G.722 or Opus is a better choice — including what that means for mobile GSM gateways.

What is G.711?

G.711 is ITU-T Recommendation G.711, “Pulse code modulation (PCM) of voice frequencies”, first published in 1972. It is the codec of the digital telephone network: every ISDN and E1/T1 channel carries G.711. Speech is band-limited to roughly 300–3,400 Hz, sampled at 8 kHz and encoded as 8-bit values. There is no compression beyond the companding step, so it needs almost no processing power and adds almost no algorithmic delay.

In VoIP, G.711 is carried in RTP with static payload types defined in RFC 3551: PCMU (µ-law) is payload type 0 and PCMA (A-law) is payload type 8.

A-law vs µ-law: companding explained

Eight bits give only 256 levels. If those levels were evenly spaced, quiet speech would be swamped by quantisation noise. Companding solves this by spacing levels logarithmically: small signals get fine steps and loud signals get coarse ones, which matches how we hear. A-law and µ-law are two slightly different approximations of that curve.

µ-law (PCMU)A-law (PCMA)
StandardITU-T G.711ITU-T G.711
RegionsNorth America, JapanEurope, Middle East, Africa, most of Asia and Latin America
Curveµ = 255, approximated by 15 segmentsA = 87.6, approximated by 13 segments
CharacteristicSlightly better for very quiet signalsSlightly wider dynamic range
Bitrate64 kbit/s64 kbit/s
RTP payload type08
Legacy trunkT1 (24 channels)E1 (30 channels)

To a listener the two sound essentially the same. What matters is consistency. On international links G.711 specifies that conversion between the two is carried out in the µ-law country, and in VoIP the rule is simpler: offer the variant your carrier uses so no gateway has to convert.

The cost of transcoding

Converting A-law to µ-law is cheap and nearly lossless. Converting between different codec families — for example G.729 to G.711, or G.711 to Opus — is not: each conversion decodes to linear audio and re-encodes it, adding CPU load, a few milliseconds of delay and a small loss of quality each time. Every transcoding step is also another place where jitter buffers and packet timing can go wrong. The best codec plan is usually the one with the fewest conversions end to end.

G.729: low bandwidth, narrowband

G.729 (ITU-T G.729, CS-ACELP) compresses narrowband speech to 8 kbit/s using 10 ms frames. Annex B adds voice activity detection and comfort noise. It was popular when WAN links were expensive, and its patents have now expired, so licensing is no longer the obstacle it once was.

The trade-offs are more processing, about 15 ms of algorithmic delay, lower quality than G.711, and poor handling of in-band tones and fax, which is why DTMF should be sent out of band (RFC 4733) on G.729 calls. It remains common on wholesale routes where bandwidth per call still matters.

G.722: wideband HD voice

G.722 (ITU-T G.722) samples at 16 kHz and carries audio from 50 Hz to 7 kHz at 64 kbit/s — the same bitrate as G.711 with roughly twice the audio bandwidth. The result is the “HD voice” quality most desk phones support: clearer consonants, easier recognition of names and numbers, and less listening fatigue. One historical quirk: RFC 3551 advertises G.722 with an 8,000 Hz RTP clock rate even though it samples at 16 kHz, and implementations follow that convention.

Opus: the adaptive codec

Opus (IETF RFC 6716, RTP payload in RFC 7587) scales from about 6 kbit/s narrowband to 510 kbit/s full-band, adapts to network conditions and has built-in forward error correction. It is mandatory to implement for WebRTC (RFC 7874), so browser and softphone calls often use it. Opus is excellent between endpoints that support it, but most carrier trunks still expect G.711 or G.729, so a call from a browser to the public network normally transcodes somewhere.

Codec negotiation in SDP

Codecs are agreed with the SDP offer/answer model (RFC 3264, with SDP itself defined in RFC 8866). The caller lists the codecs it supports in order of preference on the m= line; the answerer picks from that list. A simplified offer looks like this:

  • “m=audio 40000 RTP/AVP 9 8 0 101” — offering G.722, PCMA, PCMU and telephone-event.
  • “a=rtpmap:9 G722/8000”, “a=rtpmap:8 PCMA/8000” and “a=rtpmap:0 PCMU/8000” — the codec names and clock rates.
  • “a=rtpmap:101 telephone-event/8000” — out-of-band DTMF.
  • “a=ptime:20” — 20 ms of audio per packet.

Many “one-way audio” or “no audio” complaints on new trunks turn out to be either NAT problems or a codec mismatch, where the answer picks a codec that one leg cannot actually handle. Keep the offer list short, put the carrier’s preferred codec first, and always include telephone-event.

Codec comparison table

CodecStandardAudio bandBitrateTypical use
G.711 µ-lawITU-T G.711Narrowband (8 kHz sampling)64 kbit/sTrunks in North America and Japan
G.711 A-lawITU-T G.711Narrowband (8 kHz sampling)64 kbit/sTrunks in most other countries
G.729ITU-T G.729Narrowband (8 kHz sampling)8 kbit/sBandwidth-constrained and wholesale routes
G.722ITU-T G.722Wideband (16 kHz sampling)64 kbit/sHD voice between phones and PBXs
OpusIETF RFC 6716Narrowband to full-band6–510 kbit/sWebRTC, softphones, mobile apps
AMR3GPP TS 26.071Narrowband4.75–12.2 kbit/sMobile voice on 2G and 3G
AMR-WB3GPP TS 26.171 / ITU-T G.722.2Wideband6.6–23.85 kbit/sMobile HD voice, VoLTE
EVS3GPP TS 26.441Up to full-band5.9–128 kbit/sVoLTE and VoWiFi HD voice

Bitrates are codec payload only. IP, UDP and RTP headers add a fixed overhead per packet, so a G.711 stream with 20 ms packets uses roughly 80 kbit/s at the IP layer in each direction, and G.729 roughly 24 kbit/s, before link-layer overhead.

Which codec for a GSM gateway?

A mobile gateway has two codec worlds to bridge: the mobile network on one side and your SIP trunk or PBX on the other.

  • 2G and 3G voice uses narrowband AMR. G.711 on the SIP side preserves everything the radio leg delivers, so there is little benefit in offering wideband.
  • VoLTE and VoWiFi can use AMR-WB or EVS when handsets and networks on both ends support HD voice. Here a wideband SIP leg — G.722 or Opus — keeps that extra quality instead of throwing it away. See VoLTE and Wi-Fi calling for GSM gateways.
  • The PBX leg should match what your extensions use: G.722 between HD desk phones, Opus for WebRTC clients.
  • The carrier leg should match the carrier: A-law or µ-law by region, G.729 only where bandwidth genuinely requires it.

GSMCalls follows this model. With the Smart Bridge, the GSMCalls app streams digital wideband G.722 audio from the phone to the cloud with no PC in the path, so an HD mobile call can reach an HD extension without being squeezed through a narrowband step. Trunks toward carriers use G.711 A-law or µ-law as configured. Learn more about running a GSM gateway without a PC or the cloud GSM gateway.

Frequently asked questions

What is the difference between A-law and µ-law?

Both are G.711 companding curves at 64 kbit/s. µ-law uses µ = 255 and is standard in North America and Japan; A-law uses A = 87.6 and is standard in Europe and most other regions. They sound almost identical; the key is matching your carrier.

Does converting A-law to µ-law reduce quality?

Only very slightly. It is a table lookup between two 8-bit representations, so the loss is minimal. Transcoding between different codec families, such as G.729 to G.711, costs more quality and CPU.

Is G.729 better than G.711?

G.729 uses about one eighth of the codec bandwidth, but G.711 sounds better, adds less delay and handles tones and fax more reliably. Use G.711 unless bandwidth is genuinely constrained.

What codec is HD voice?

On IP phones, HD voice usually means G.722 (wideband, 50 Hz–7 kHz at 64 kbit/s) or Opus. On mobile networks it means AMR-WB or EVS, typically over VoLTE or VoWiFi.

Which codec should I use with a GSM gateway?

Match the carrier on the trunk side (A-law or µ-law) and your extensions on the PBX side. If the mobile leg is VoLTE HD, keep a wideband codec such as G.722 on the IP side to preserve quality.