A voice codec is the method a phone system uses to turn speech into digital data and back. It sets the bit rate, the audio bandwidth and how well speech survives packet loss. Common contact-center codecs are G.711 at 64 kbit/s, G.729 at 8 kbit/s and Opus. Both ends must agree on a codec, or a transcoder must convert between them.
Common codecs compared
The codec rate is only the speech payload. Network headers add more, as the next section shows.
| Codec | Defined in | Rate | Notes |
|---|---|---|---|
| G.711 (PCMU, PCMA) | ITU-T G.711 | 64 kbit/s | 8 bits per sample at 8,000 samples per second; mu-law or A-law |
| G.729 | ITU-T G.729 | 8 kbit/s | 10 ms frames; default RTP packet is 20 ms (two frames) |
| Opus | IETF RFC 6716 | 6 to 510 kbit/s | Variable rate; required in WebRTC with G.711 |
How does the codec change bandwidth?
This is the method used by the ContactCenter.me VoIP bandwidth calculator. Packets per second = 1000 ÷ packet interval in ms. Payload bytes = codec rate × packet interval ÷ 8. Each packet adds 40 bytes of IPv4, UDP and RTP headers, plus link-layer bytes. Bandwidth per call = packet size × 8 × packets per second, in each direction.
Worked example with 20 ms packets: G.711 payload = 64,000 × 0.020 ÷ 8 = 160 bytes. With 40 header bytes and 18 Ethernet bytes, the packet is 218 bytes, so 218 × 8 × 50 = 87,200 bit/s, about 87.2 kbps. G.729 payload is 20 bytes, so (20 + 58) × 8 × 50 = 31,200 bit/s, about 31.2 kbps. For 20 concurrent calls that is 1.74 Mbps versus 0.62 Mbps per direction.
Trade-offs to weigh
Lower bandwidth is not free.
- Compressed codecs can distort DTMF tones and may hurt speech recognition used by analytics or AI agents.
- Every transcoding step adds delay and can reduce quality.
- Wideband codecs such as Opus can sound clearer, but only if every leg keeps the wideband audio.
- Header overhead matters most for low-rate codecs.
How to choose
Match the codec on every leg where you can, to avoid transcoding. Check what your carrier, platform and agent softphones each support. RFC 3551 lists the standard RTP payload types, such as 0 for PCMU and 18 for G.729. Then confirm the negotiated codec in real call traces, not only the configured list.
Questions about Codec
Which codec gives the best call quality?
No codec is best everywhere. G.711 is uncompressed narrowband audio and is widely supported. Opus can carry wideband speech and adapts its rate. Quality also depends on transcoding, packet loss and jitter, so test the full call path with your carriers.
Why is my VoIP bandwidth higher than the codec rate?
Each packet carries IP, UDP and RTP headers plus link-layer framing. With 20 ms packets that is 50 packets per second. For G.729 the headers are larger than the 20-byte voice payload, so the per-call rate is about 31.2 kbps on Ethernet.
What is transcoding?
Transcoding is converting audio from one codec to another, for example from Opus in a browser softphone to G.729 on a carrier trunk. It uses processing power, adds delay and can reduce quality, so it is best kept to one point in the call path.
Sources
- ITU-T Recommendation G.711: Pulse code modulation (PCM) of voice frequencies
- ITU-T Recommendation G.729: Coding of speech at 8 kbit/s using CS-ACELP
- IETF RFC 3551: RTP Profile for Audio and Video Conferences