Twilio

Twilio Video Audio not Working

Twilio Video audio fails when the page isn't HTTPS, mic is denied, or autoplay blocks audio. One-way SIP/PSTN audio indicates NAT blocking UDP media ports.

Updated Jul 1, 2026

The short answer

"Twilio Video audio not working" is a symptom, not an error code. In browser WebRTC apps it usually means the page is not on HTTPS, mic permission was denied, the mic is held by another app, or autoplay blocked remote audio; the Video SDK surfaces these via getUserMedia errors and Preflight, not numeric codes. On PSTN or SIP calls it is typically one-way audio from NAT or firewall blocking UDP media ports 10000-60000. Fix it by checking NAT and SIP ALG first.

"Twilio Video audio not working" is not a documented Twilio error code or SMTP-style reply — it's a catch-all symptom that maps to several distinct, diagnosable root causes depending on whether you're using a browser WebRTC SDK (Twilio Video JS, or the Voice JS SDK) or a PSTN/SIP voice call. Identify which path you're on first, then apply the matching fix below.

What causes "Twilio Video audio not working"?

The most common root causes, by environment:

Browser WebRTC (Twilio Video JS / Voice JS SDK):

  • Insecure context. getUserMedia() only works on localhost or an HTTPS origin. Over plain HTTP, navigator.mediaDevices is undefined and no mic track is ever acquired.
  • Microphone permission denied. The user dismisses the prompt, the site has a saved "block", or the OS denies mic access. In the Voice JavaScript SDK this surfaces as error 31401 (UserMedia Permission Denied). The Video JavaScript SDK does not emit that numbered code — instead the underlying getUserMedia() call rejects with a DOMException whose name is NotAllowedError, and createLocalAudioTrack() fails.
  • Acquisition failed. Permission is granted but the SDK still can't get a stream, often from an invalid deviceId or over-restrictive constraints. In the Voice JavaScript SDK this is error 31402 (UserMedia Acquisition Failed). In the Video JavaScript SDK the same condition appears as a getUserMedia() rejection (NotReadableError, OverconstrainedError, etc.) rather than a 314xx code.
  • Microphone reserved by another app/tab. On mobile browsers especially, getUserMedia() can succeed yet produce a silent track because another tab or app holds the device. The participant joins but no one can hear them.
  • Autoplay policy. Browsers block unmuted <audio>/<video> from autoplaying without a user gesture, so remote participants' audio never plays back even though it's arriving.
  • Network blocking media. WebRTC needs UDP to Twilio's media servers (ports 10000-60000); if a firewall blocks it and no TURN fallback is configured, signaling succeeds but audio never flows.

PSTN / SIP voice calls (one-way audio): signaling completes and the call connects, but audio is missing in one direction. This is almost always a NAT/firewall issue: the SDP advertises a private/unreachable media address, or a firewall/SIP ALG blocks the RTP path.

How do I fix Twilio audio not working in the browser?

  1. Serve over HTTPS. Confirm the app runs on https:// or localhost. If navigator.mediaDevices is undefined, this is your cause.
  2. Request the mic early and check support. Call navigator.mediaDevices.getUserMedia({ audio: true }) before creating the Device/Room to surface permission/acquisition failures sooner, and gate on the SDK's isSupported flag.
// Probe permission and supported browser before connecting
if (!Twilio.Video.isSupported) { /* show unsupported-browser message */ }
try {
const stream = await navigator.mediaDevices.getUserMedia({ audio: true });
stream.getTracks().forEach(t => t.stop()); // release until you actually join
} catch (e) {
// e.name === 'NotAllowedError' -> guide user to re-enable mic permission
}
  1. Clear a saved "block". If permission was previously denied, the browser remembers it — have the user reset the site's microphone permission and OS-level mic access, then reload.
  2. Detect a reserved/silent mic. Acquire a LocalAudioTrack, feed it through a Web Audio AnalyserNode, and measure the RMS level. If it stays at 0 while the user speaks, the device is reserved — instruct them to close other apps/tabs and restart the browser.
  3. Work around autoplay. Only attach and unmute remote audio elements after a user gesture (a "Join" button click counts).
  4. Simplify constraints when acquisition fails (Voice SDK 31402). Remove custom rtcConstraints, test with plain audio: true, validate the deviceId against device.audio.availableInputDevices, and call device.audio.unsetAudioConstraints() if you set custom audio settings.
  5. Diagnose with Twilio's tooling. Use the RTC Diagnostics SDK and the Preflight API (Video JS SDK 2.16.0+, public beta) for pre-call mic/speaker and connectivity tests; enable Media Warnings (Video JS SDK 2.34.0+) to catch when Twilio's media server detects no media on a published track; inspect rooms with the Video Log Analyzer.

How do I fix one-way audio on a Twilio PSTN/SIP call?

  1. Open the media ports. Allow UDP 10000-60000 to/from Twilio's media subnet (168.86.128.0/18) and let your hosts initiate the connection outbound (SRTP/DTLS). Signaling is TCP 443.
  2. Disable SIP ALG on the router/firewall — it frequently rewrites SDP incorrectly and breaks the media path. Fix the NAT/ALG first; it resolves most one-way-audio cases without weakening security.
  3. Enable Symmetric RTP only as a last resort. Behind a non-SIP-aware NAT your SDP may carry a private IP; Symmetric RTP makes Twilio send media back to the address it actually received RTP from rather than the advertised one. Twilio disables this by default and recommends it only when no proper RTP stream can be established otherwise, because it can expose you to RTP injection/RTP bleed.
  4. Fall back to TURN when UDP is unavailable: configure Twilio's Network Traversal Service (NTS) TURN credentials via iceServers so media can relay over TCP/TLS.

With Courier

Courier sends notifications (SMS, email, push, chat) through providers like Twilio, but does not run the WebRTC media plane for Twilio Video or Voice calls. The fixes above are configured in your application and Twilio Console, not in Courier.

FAQ

Common questions

No. It's a symptom description, not a documented Twilio or RFC error code. The closest official codes are 31401 (UserMedia Permission Denied) and 31402 (UserMedia Acquisition Failed) for browser mic access, plus one-way-audio guidance for SIP/PSTN calls.

One API, every provider

Stop debugging raw provider errors

Courier connects to your email, SMS, and push providers, handles retries and failover, and surfaces delivery errors in plain language.

Last reviewed Jul 1, 2026. Courier is not affiliated with third-party providers; error behavior may vary by implementation.