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

31402: UserMedia Acquisition Failed

Twilio Voice DocumentationVoice

Description

description page anchor

This error occurs when the browser has microphone permission, but the Voice JavaScript SDK cannot acquire the input media stream for a call. This usually points to an invalid device selection, overly restrictive getUserMedia() constraints, or a browser, operating system, or hardware issue.

Possible causes

possible-causes page anchor
  • A deviceId passed to device.audio.setInputDevice() does not exist or is no longer available.
  • The rtcConstraints passed to device.connect() are too restrictive, so getUserMedia() cannot match an available device.
  • Audio constraints applied with device.audio.setAudioConstraints() cannot be satisfied by the selected microphone.
  • The browser, operating system, or local audio hardware cannot provide the microphone stream even after permission is granted.
  • Verify that the selected microphone exists in device.audio.availableInputDevices before you call device.audio.setInputDevice().
  • Remove custom rtcConstraints or other audio constraints and test again with a simpler input request such as audio: true.
  • If you apply constraints with device.audio.setAudioConstraints(), clear them with device.audio.unsetAudioConstraints() and retry.
  • Call getUserMedia() before you create the Device so you can detect microphone and device issues earlier and refresh the available device list before a call starts.
  • Test with the default input device first, then confirm the microphone works in the browser and operating system.

Additional resources

additional-resources page anchor