setSinkId method

JSPromise<JSAny?> setSinkId(
  1. JSAny sinkId
)

The setSinkId() method of the AudioContext interface sets the output audio device for the AudioContext. If a sink ID is not explicitly set, the default system audio output device will be used.

To set the audio device to a device different than the default one, the developer needs permission to access to audio devices. If required, the user can be prompted to grant the required permission via a MediaDevices.getUserMedia call.

In addition, this feature may be blocked by a speaker-selection Permissions Policy.

Implementation

external JSPromise<JSAny?> setSinkId(JSAny sinkId);