setAudioDevice()

setAudioDevice(deviceId)

Updates the local audio stream with the audio device identified by the deviceId argument. The deviceId argument should match the deviceId value returned by enumerateDevices().

Returns a Promise which resolves with an object containing the deviceId that has been applied.

The deviceId returned will be different from the requested deviceId in cases where the audio device becomes unavailable. For example, if you request to use a Bluetooth device and the device becomes disconnected.