Back to Insights
VoIP Engineering

Codec Selection for Voice AI: Why Opus is Replacing G.711 in Modern Pipelines

Telephony Engineering Team
6 min read
Codec Selection for Voice AI: Why Opus is Replacing G.711 in Modern Pipelines

Codec selection sounds like a low-level implementation detail until it starts silently degrading transcription accuracy across an entire voice AI deployment. The choice between Opus and G.711 affects audio bandwidth, latency, and — critically for AI pipelines — how much usable signal actually reaches the speech-to-text model.

The Legacy Standard: G.711

G.711 has been the default telephony codec since the ISDN era — 8kHz sampling, no compression, near-zero encoding latency, and universal carrier support. Its ubiquity is exactly why it's still the default on most SIP trunks today. The problem is that 8kHz sampling caps the frequency range at roughly 4kHz, discarding the higher-frequency detail that modern ASR (automatic speech recognition) models are trained on and rely on for accuracy, especially with accented speech or noisy call environments.

The Modern Standard: Opus

Opus was designed for real-time communication from the ground up — variable bitrate, sampling up to 48kHz, and built-in packet loss concealment that G.711 simply doesn't have. For voice AI specifically, Opus's wider frequency response translates directly into measurably better transcription accuracy, particularly for shorter utterances and quick interruptions where every millisecond of signal matters.

PropertyG.711Opus
Sample rate8kHzUp to 48kHz
Bandwidth usage~64kbps fixed6–510kbps variable
Packet loss concealmentNone nativelyBuilt-in
ASR accuracy impactBaselineMeasurably higher
Carrier/PSTN supportUniversalRequires negotiation or transcoding

The Transcoding Trap

The catch: most PSTN calls still arrive as G.711 because that's what the carrier network speaks. Running a voice AI pipeline internally on Opus while receiving G.711 from the trunk means a transcoding step happens somewhere — and if that transcoding happens carelessly (naive resampling rather than proper codec conversion), you can actually lose more signal than you gained by choosing Opus in the first place.

Getting the Full Benefit

To actually realize Opus's accuracy advantage, the codec needs to be preserved as far into the pipeline as possible:

  1. Negotiate Opus on the WebRTC/browser leg where the calling client supports it
  2. Use a media server (FreeSWITCH) capable of high-quality resampling rather than lossy shortcuts when a PSTN leg forces G.711
  3. Feed the ASR model the highest-fidelity audio available at each point in the call, rather than downsampling early for convenience

Seeing inconsistent transcription accuracy in a voice AI deployment? Controva LLC audits the full audio pipeline — codec negotiation, transcoding, and ASR input quality — not just the model.

Discussion

0

Join the conversation

Sign in with your preferred account to comment, reply, and keep the discussion useful for other engineers.

Takes a few seconds. No separate password required.

C

Controva LLC

Engineering Team

We build digital empires that scale. Specializing in high-performance web architecture, AI automation, and headless commerce.

Work with us

Share this article