AudioSession API seems to be focused on mobile platforms, where the web application usually cannot control which output device audio is rendering to.
On the other hand, on desktop various audio tags and AudioContext entities can play to different output devices (setSinkId API). And in general applications do want to control to which device audio is rendered.
The output audio device is a shared system resource, and audio session/audio focus seem to be meaningful in the context of a shared usage of a specific resource.
Maybe we can align this all by extending AudioSessionState with optional sink id which would act as a default audio output device, in the meaning proposed by "Set Default Audio Output Device"?
AudioSession API seems to be focused on mobile platforms, where the web application usually cannot control which output device audio is rendering to.
On the other hand, on desktop various audio tags and AudioContext entities can play to different output devices (setSinkId API). And in general applications do want to control to which device audio is rendered.
The output audio device is a shared system resource, and audio session/audio focus seem to be meaningful in the context of a shared usage of a specific resource.
There is also Set Default Audio Output Device proposal https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/SetDefaultSinkId/explainer.md#set-default-audio-output-device for an application to centralize the control over where its various audio elements are playing audio to.
Maybe we can align this all by extending AudioSessionState with optional sink id which would act as a default audio output device, in the meaning proposed by "Set Default Audio Output Device"?