Skip to contentSkip to navigationSkip to topbar
Page toolsOn this pageProducts used
Looking for more inspiration?Visit the

31201: Twilio Client: Error occurred while accessing microphone


ERROR: 31201

error-31201 page anchor
VOICE
ERROR

This error is emitted by the Voice JavaScript SDK, formerly Twilio Client, when the browser has granted permission but getUserMedia fails to acquire the microphone during actions such as device.connect or connection.accept. In Voice JS SDK 2.x, this condition maps to error 31402 UserMedia Acquisition Failed.

Possible causes

possible-causes page anchor
  • The browser granted permission but getUserMedia couldn't create an input audio stream when initiating or accepting a call.
  • The microphone deviceId specified via Device.audio.setInputDevice is invalid or no longer available, producing a NotFoundError.
  • Disconnected or faulty headset or driver issues prevent the SDK from accessing the microphone.
  • Another application temporarily takes control of the microphone, causing loss of access until the app regains focus and reacquires input.
  • Select a valid input device or clear any stale selection, for example by using Device.audio.setInputDevice or unsetting constraints, then retry the call.
  • Reconnect or replace the microphone and resolve headset driver problems, then retry.
  • Close other applications that may be using the microphone and, when focus returns to your app, reacquire the microphone before placing or resuming a call.
  • Use the Voice JS SDK PreflightTest to validate device and network before starting calls and review the report for capture issues.
  • If your app has migrated to Voice JS SDK 2.x, handle error 31402 for the same underlying user media acquisition failure.

Additional resources

additional-resources page anchor