Audio codec
An audio codec is a method for encoding sound into digital data for transmission or storage and decoding that data back into playable audio. In a phone call, the codec determines how speech is represented inside the media packets moving between endpoints.
How audio codecs work
A codec samples incoming sound and compresses it according to a defined format. The receiving endpoint applies the matching decoder to reconstruct an approximation of the original waveform. Call setup typically includes a negotiation in which both sides advertise supported formats and select one they share.
Codec designs balance several goals: speech clarity, bandwidth use, processing cost, delay, resilience to packet loss, and compatibility with existing phone networks. A narrowband telephony codec may be widely interoperable but preserve less vocal detail. A wideband or adaptive codec can carry more natural speech, yet a gateway may need to convert it before sending the call across a legacy route.
That conversion is called transcoding. Each transcode can add processing time and can discard information that a later, higher-quality codec cannot restore. Avoiding unnecessary codec changes is therefore often as important as choosing a strong codec at the beginning of the call.
The codec and RTP play different roles. The codec defines the audio representation; RTP carries encoded chunks with timing and ordering information. SRTP can encrypt those packets without changing the codec's underlying job.
Why audio codecs matter for AI phone calls
An AI phone agent must interpret the caller's encoded speech and return speech through the same media chain. A codec that removes useful detail, combined with background noise or packet loss, can make names and short answers harder to distinguish. On the outbound side, repeated transcoding can make otherwise clear generated speech sound thin or distorted.
Codec testing should follow the real route, not only a browser preview. Check representative carriers, gateways, devices, accents, background conditions, and transfers. If quality changes after a transfer or when calling a particular network, inspect the negotiated codec and transcode path before changing the agent's prompt or dialogue logic. Media telemetry and sample call review can help separate codec artifacts from recognition, synthesis, or turn-taking problems.