Audio codec

Audio codec

Audio codec

TL;DR

TL;DR

An audio codec is the algorithm that compresses voice into packets for transmission and reconstructs it on arrival, trading bandwidth against how much detail survives the trip.

An audio codec is the algorithm that compresses voice into packets for transmission and reconstructs it on arrival, trading bandwidth against how much detail survives the trip.

What is an audio codec?

An audio codec is the algorithm that compresses a voice signal into digital frames for transmission and reconstructs an audible waveform at the other end. Every phone call, softphone session, and voice agent conversation runs through at least one, usually more than one. The choice is negotiated at call setup.

The bandwidth spread is wide. G.711 sends uncompressed toll-quality audio at 64 kbps, while G.729 fits the same conversation into 8 kbps, an eight-fold difference that decides trunk sizing once a contact center is carrying thousands of concurrent calls at peak.

How an audio codec works

A codec sits inside a chain with four stages: capture, encode, transport, decode. Capture samples the analog waveform thousands of times a second and quantizes each sample into a number. Encoding then applies compression, and the two families work differently. G.711 uses companding, a logarithmic mapping of sample values that discards very little. G.729 and Opus model the vocal tract itself and transmit parameters that let the far end resynthesize speech from a fraction of the data.

The encoded frames are packetized and pushed onto the network. On paths that cross the public switched telephone network, the media is often re-encoded at a gateway, and the codec each leg uses is agreed during signaling, the same signaling that later carries a SIP transfer. At the receiving end the decoder rebuilds a waveform and fills gaps with packet loss concealment when frames go missing. Everything downstream, including automatic speech recognition, only ever sees that reconstructed audio.

Types of audio codecs

Codecs divide by bitrate and by the frequency range they preserve. Four show up repeatedly in contact center deployments.

  • G.711 (a-law and mu-law): Uncompressed narrowband audio at 64 kbps, the default across carrier trunks and legacy PBX equipment, cheap to encode and expensive to carry.

  • G.729: A compressed narrowband codec at 8 kbps that sounds noticeably thinner, usually chosen when trunk bandwidth is the binding constraint.

  • Opus: A variable-bitrate wideband codec and the default for WebRTC, adapting its rate as network conditions change mid-call.

  • AMR-WB: The wideband codec behind HD Voice on mobile networks, carrying the higher frequencies that keep consonants distinct.

Carrier networks and older phone infrastructure frequently force G.711 or G.729, while browser-based channels negotiate Opus without being asked.

Audio codec vs container format vs transport protocol vs signaling protocol

Codec, container, and protocol get used loosely in the same sentence, and the ambiguity costs hours when a call sounds wrong and nobody knows which layer to open first. A container format holds already-encoded audio in a file alongside metadata such as timestamps and channel counts. A transport protocol carries codec frames across the network with sequence numbers and timing information. A signaling protocol sets the call up and decides which codec both endpoints will actually use. An audio codec is the only one of these four layers that touches the waveform itself.


What it holds

Ownership

Who reads it

AI-retrievable

Choose it when

Audio codec

A compressed representation of the speech waveform

Negotiated between endpoints at call setup

Encoders, decoders, and every model downstream

Yes, it is the audio the model hears

You are trading sound quality against bandwidth

Container format

Encoded audio plus metadata, written to a file

Recording and archive systems

Media players, QA tooling, storage jobs

Yes, once the file has been decoded

You are storing, replaying, or exporting a call

Transport protocol

Timestamped packets carrying codec frames

The media path and the network team

Jitter buffers, media servers, SBCs

No, it wraps audio without altering it

You are chasing jitter, delay, or packet loss

Signaling protocol

Call setup, codec offers, transfer instructions

Carrier and PBX configuration

Softswitches, session border controllers

No, it carries no audio at all

You are routing, transferring, or debugging setup

If the complaint is about sound quality, look at the codec and at whatever transcoded it. If the complaint is choppy or delayed audio, the transport layer owns it. If the call never connected properly, start with signaling.

Why audio codecs matter for customer experience

When the codec is wrong, nothing throws an error. A narrowband codec caps audio at roughly 3.4 kHz, which is why “S” and “F” collapse into each other on a bad line and why a customer spelling a surname repeats it three times. Recognition systems trained largely on wideband audio lose accuracy when fed 8 kHz narrowband streams, and heavy compression strips the harmonic detail that separates similar phonemes, so errors cluster exactly where they hurt most: names, postcodes, card digits, order numbers.

The damage compounds along the path. A call that starts as Opus in a browser, converts to G.711 at the SIP gateway, then to G.729 over a carrier trunk arrives degraded twice over, with milliseconds added at each conversion. The tradeoff is explicit and unavoidable: every kilobit saved on the trunk is detail the recognizer never receives, and at high volume, as AI adoption in telecom support shows, that arithmetic gets settled one way or the other.

How is an audio codec measured?

Two families of measurement apply to codecs, and they routinely disagree. Perceptual quality is scored by human listeners on a mean opinion score, or estimated by objective models such as PESQ and POLQA, which compare a degraded sample against the original. Those scores describe how a person experiences the call.

Machine intelligibility is the second family, and it is the one voice automation lives on: word error rate for the same utterances encoded through each candidate codec, scored against a transcript you already trust. The NIST Speaker Recognition Evaluation is the closest public reference for how strongly the channel shapes results, since its evaluation conditions span narrowband 8 kHz telephone recordings through 16 kHz wideband microphone captures, and performance is reported condition by condition.

Run the comparison on recordings pulled from your own trunks. A codec that scores well on clean lab audio gives back much of that margin over a congested network.

How AI agents change audio codec decisions

A voice agent puts a model where a human ear used to sit, and the two tolerate compression very differently. People reconstruct a mangled word from context without noticing they did it. A recognition model scores acoustic evidence, so when compression removes the harmonic detail that separates similar sounds, the evidence is gone and the model guesses.

Speech-to-speech architectures raise the stakes further, because the audio never passes through a text stage in the middle. Artifacts introduced on a lossy leg propagate into the model’s reading of tone and timing, and then into the pacing of what it says back.

The consequence is organizational. Codec selection used to belong to whoever sized the trunks. It now belongs to whoever is accountable for containment, and teams deploying AI voice agents for phone customer service tend to pin wideband on the legs they control and count every transcode on the legs they do not.

What to look for when choosing an audio codec

Start with coverage: which codecs your platform can offer and accept on each leg, and whether wideband survives end to end or dies at the first gateway. Integration surface comes next, because the session border controller or media gateway is where transcoding actually happens, and it is the only place you can stop it happening twice.

Governance is the axis teams skip. Whoever owns the telephony configuration owns the codec offer list, and when that sits in a carrier ticket queue, changing one codec becomes a two-week project. Regulated buyers ask how media is encrypted in transit and where call recordings are stored; HIPAA and GDPR are the two frameworks that question usually arrives attached to.

The constraint that bites at scale is CPU. Transcoding is per-stream work, so a thousand concurrent calls each needing re-encoding is a capacity plan, and wideband recordings consume more storage per hour than the narrowband archives they replace.

Audio codecs and the voice AI stack

The codec bookends every agent turn. Inbound, it decides what the recognizer hears. Outbound, it decides what the caller hears of the system’s own speech synthesis, because a carefully tuned wideband voice pushed through an 8 kHz carrier trunk arrives sounding like the IVR it was meant to replace.

Compression also flattens the fine identity cues that make voice cloning recognizable as a specific person, which matters when a consistent brand voice is the whole point of the deployment.

What does audio codec mean in plain terms?

Think of an audio codec as a shipping method for sound. The raw recording is bulky, so the sender packs it down before it travels and the receiver unpacks it on arrival. Codec is short for coder-decoder, the paired programs doing the packing and the unpacking. Some methods keep everything and need a large truck. Others throw away whatever the sender expects nobody will miss.

With no packing at all, one conversation would consume far more capacity than a phone line was built to carry, and calls would break up long before quality became the interesting question.

The tradeoff lives in the guessing. Discarding the parts a human ear glosses over works beautifully on a human listener and poorly on software listening for the difference between fifteen and fifty.

Common audio codec mistakes

Treating the codec as a network setting nobody owns is the first pattern. The offer list stays at whatever the gateway shipped with, and a decision that shapes recognition accuracy on every call gets made once by a default.

Testing on the wrong audio is the second. Accuracy is validated on clean studio recordings, then the system is deployed onto 8 kHz trunks, and the gap arrives as a vague report that the model got worse in production.

Stacking transcodes without counting them is the third. Each hop re-encodes an already lossy signal and adds delay, so a chunk of the latency budget is spent before the model has said a word.

Optimizing bandwidth first is the fourth. Trunk cost appears on an invoice, while misrecognized order numbers appear as longer handle times and repeat contacts, so the cheaper codec wins the meeting and loses the money somewhere less visible.

Frequently Asked Questions

What is the difference between G.711 and G.729?

G.711 and G.729 are both narrowband codecs with very different economics. G.711 sends essentially uncompressed audio at 64 kbps and preserves the most detail. G.729 compresses the same conversation into 8 kbps by modeling the vocal tract, saving eight times the bandwidth while sounding thinner and adding roughly 15 ms of encoding delay.

Is Opus better than G.711 for voice AI?

Opus generally serves voice AI better on legs where both endpoints support it, because it is wideband and carries frequencies above the narrowband ceiling that recognition models rely on. G.711 remains the safer choice across carrier trunks and legacy equipment. Many deployments run Opus on the browser leg and accept a single conversion at the gateway.

What does codec stand for?

Codec is a contraction of coder-decoder, the two halves of the same component. The coder compresses captured audio into frames small enough to send across a network, and the decoder rebuilds a playable waveform at the far end. The term applies to video and file compression as well, though voice codecs are tuned specifically for speech.

Does audio codec choice affect speech recognition accuracy?

Audio codec choice affects recognition accuracy measurably, particularly on short, information-dense tokens. Narrowband and heavily compressed streams discard harmonic detail that distinguishes similar consonants, so errors concentrate in names, addresses, and digit strings. Models trained largely on wideband audio degrade further when fed 8 kHz input, which is why teams benchmark word error rate per codec.

What is transcoding in a voice call?

Transcoding is decoding audio from one codec and re-encoding it into another mid-call, usually at a gateway or session border controller joining two networks that support different codecs. Each transcode discards more detail from an already lossy signal and adds a few milliseconds of delay, so a call crossing three networks can be degraded repeatedly.

Which audio codec should a contact center use?

The audio codec a contact center should use depends on which legs it controls. Wideband codecs such as Opus or AMR-WB preserve the most detail for automation and should be kept end to end wherever possible. Where carrier trunks force narrowband, G.711 protects more quality than G.729, and bandwidth savings should be weighed against recognition errors.

Learn More

Learn More

Knowledge base

K

Average handling time (AHT)

A

Telephony

T

Customer acquisition cost (CAC)

C

Business process outsourcing (BPO)

B

AI tokens

A

Human in the loop (HITL)

H

AI grounding vs retrieval-augmented generation (RAG)

A

Short message service (SMS)

S

Call center

C

Data annotation

D

Ticket routing

T

Customer service quality assurance (QA)

C

Live chat

L

Speech Synthesis Markup Language (SSML)

S

Batch inference

B

Barge-in

B

SLA compliance rate

S

Queue management

Q

Prompt versioning

P

Emotion detection

E

Retrieval-augmented generation (RAG)

R

Natural language understanding (NLU)

N

Text classification

T

Call routing

C

Customer churn rate

C

Speech-to-speech

S

Intent recognition

I

Voice of the employee (VoE)

V

Confidence score

C

Resolution-based pricing

R

AI personalization

A

Voice cloning

V

Asynchronous messaging

A

Hallucination

H

ReAct agent pattern

R

Long-term memory

L

Forecast accuracy

F

Customer feedback loop

C

Structured output

S

Outbound voice AI

O

AI guardrails

A

Direct preference optimization (DPO)

D

Prompt chaining

P

SIP transfer

S

Fallback intent

F

Conversation summarization

C

Auto-tagging

A

Cost per contact

C

VoIP jitter

V

Model card

M

Ticket prioritization

T

Sentiment analysis

S

Agent utilization rate

A

Speech-to-intent

S

Prompt engineering

P

Knowledge atlas

K

SOC 2 AI support

S

Prosody

P

Chatbot containment rate

C

Speech synthesis

S

Intelligent virtual agent (IVA)

I

Fine-tuning

F

ISO 42001

I

Intent-based search

I

After-call work (ACW)

A

Chatbot

C

AI agent

A

Prior authorization automation

P

AI customer service

A

Ticket deflection

T

AIUC-1

A

Workforce management (WFM)

W

Skill-based routing

S

Interactive voice response (IVR)

I

Contact center as a service (CCaaS)

C

Warm transfer

W

Customer segmentation

C

Reinforcement learning

R

Voice activity detection (VAD)

V