SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

Surface Audio and Network Issues with Twilio Voice JavaScript SDK 1.4 and Later

In our experience, the vast majority of Twilio Voice JavaScript SDK (formerly "Twilio Client") call quality issues are due to local network conditions (things like high latency or packet loss) or hardware issues (microphone input not being passed to the browser, or audio output from the SDK not reaching the speaker). This guide explains the available warnings and notifications for these kinds of issues.

If you're not surfacing audio warnings when USB mics aren't delivering audio to the browser, or letting users know when network conditions could be causing audio issues, we highly recommend doing so. Starting with version 1.4, Twilio's Voice JavaScript SDK gives you some tools to accomplish this:

  • Use the warning event emitters to surface things like constant audio input/output levels (one-way audio/local hardware issues), high RTT (latency), and high jitter/high packet loss (network connectivity trouble) to the users.
  • Use the volume handler to display a waveform of the mic input and speaker output to provide instant visual feedback to the user that something might be amiss with their local audio hardware; e.g. microphone plugged in but no waveform, output waveform but no sound to your headset, etc. We've got some examples on using this functionality here.

Our SDK contains sensors that are dependent on WebRTC APIs, which are in turn dependent on the browser, which get its audio information from the operating system, which gets its audio information from audio hardware drivers. Our visibility extends only to the Twilio SDK level, so scenarios where a browser gets into an inconsistent state and stops passing microphone audio to the WebRTC APIs would look the same to us as call where the physical microphone hardware failed: we would see no input at the SDK sensor level, and raise a constant-audio-input-level warning. Our warning events can tell you when the SDK isn’t receiving audio, but not why. To view these events in detail or in aggregate, and to know which users are getting affected, Twilio Voice Insights provides project-wide metrics as well as individual call-level insights.

Users may still report issues, but surfacing these details in your application gives users actionable information to try to address in real time instead of letting them get frustrated because they don't know why their call is experiencing issues.

Our go-to recommendation for troubleshooting audio issues for Voice JS SDK calls is always to restart the browser. Barring any legitimate hardware failures, or intractable network performance issues, a simple restart of the browser will likely eliminate any transient call quality issues. On the subject of network issues, we provide a network test tool with the ability to place a regional test call to verify  two-way media and a bandwidth test to illustrate network capacity.

If you have any questions about any of the topics discussed  above, or have call quality issues you would like help investigating, please contact support.

Have more questions? Submit a request
Powered by Zendesk