w3c / audio-session

https://w3c.github.io/audio-session/
Other
2 stars 3 forks source link

Introduce optional default sink id #20

Closed o1ka closed 1 month ago

o1ka commented 2 months ago

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"?

o1ka commented 1 month ago

duplicate of w3c/audio-session-detach#6