Skip to main content
setAudioDevice(deviceId) Switches the local audio stream to the device identified by deviceId. The deviceId should match a deviceId value returned by enumerateDevices(). If the requested device becomes unavailable (for example, a Bluetooth device that disconnects), the resolved deviceId may differ from the one requested.

Parameters

string
required
The deviceId of the audio device to switch to.

Return value

Returns a Promise<{ deviceId: string }> with the deviceId of the audio device that was actually applied.

Example

See also