# Codec
> Coder-decoder algorithm that compresses and decompresses voice data for VoIP transmission

A codec encodes and decodes audio or video for efficient transmission over IP networks.

## What is a codec?
A codec (coder-decoder) is an algorithm that compresses voice or video data for transmission over a network and decompresses it at the receiving end. In VoIP, the choice of codec directly impacts call quality, bandwidth consumption, and latency.

## Common VoIP codecs
Popular codecs include [G.711](/voip-glossary/g711/) (uncompressed, toll quality), [G.729](/voip-glossary/g729/) (compressed, low bandwidth), and Opus (adaptive, used in [WebRTC](/voip-glossary/webrtc/)). Each trades off between bandwidth efficiency and audio fidelity.

## Codec negotiation in softphones
During call setup, [SIP](/voip-glossary/sip/) endpoints negotiate which codec to use via SDP (Session Description Protocol). Modern softphone platforms support multiple codecs and select the optimal one based on network conditions.

## What codecs should I support in a business VoIP app?
**Core codecs (must-have):**
- **Opus** — best all-around. Adaptive bitrate, wideband, handles poor networks well.
- **G.711 (μ-law/a-law)** — universal compatibility, no licensing cost. Use as fallback.
- **G.722** — HD voice over LAN/Wi-Fi, ideal for office environments.

**Optional but common:**
- **G.729** — low bandwidth, useful on mobile data. In Acrobits apps it requires licensing (in-app purchase or post-paid per active user).
- **iLBC** — avoid prioritizing. It can be selected unexpectedly on mobile data even with good signal. Remove it or push it last.

**Configuration tips:**
- Set separate codec priorities for Wi-Fi vs. mobile data.
- Opus first on both, G.711 as fallback.
- G.729 only when bandwidth is genuinely constrained.
- Avoid iLBC unless your PBX requires it.

**One thing operators often miss:** codec order in provisioning is your offered SDP priority. If your PBX only supports G.729 and it is not in the app's SDP, calls will fail with *488 Unacceptable Here*. Align both sides.

## Related Terms
- [G.711](/voip-glossary/g711/)
- [G.729](/voip-glossary/g729/)
- [HD Voice](/voip-glossary/hd-voice/)
