# 31006: Audio device error

Log Level: ERROR

## Description

Twilio raises this Voice error when it can't start the audio device.

### Possible causes

* The browser has not been granted microphone access.
* A USB headset is disconnected or faulty.
* Headset driver issues are preventing the audio device from starting.

### Possible solutions

* Ask for microphone access before you create the `Device` object by calling `navigator.mediaDevices.getUserMedia({ audio: true })`, and stop the tracks right away if you only need the device list. This helps surface `getUserMedia` errors early.
* Update your device picker when `device.audio.on('deviceChange', ...)` fires so the UI reflects microphones or headsets that are plugged in, unplugged, or relabeled.
* If users select a specific microphone, call `device.audio.setInputDevice()` before `device.connect()` or `call.accept()`, then call `device.audio.unsetInputDevice()` after the call disconnects so future calls can fall back to the default input device.
* If you use Flex, keep initial audio device check enabled so Flex verifies device health at startup, on browser refresh, and when the available device list changes.

#### Additional resources

* [Voice JavaScript SDK: Best Practices](/docs/voice/sdks/javascript/best-practices)
* [Twilio.Device.audio](/docs/voice/sdks/javascript/twiliodevice/device-audio)
* [Initial Audio Device Check](/docs/flex/end-user-guide/initial-audio-device-check)
