WebAudio / web-audio-api

The Web Audio API v1.0, developed by the W3C Audio WG
https://webaudio.github.io/web-audio-api/
Other
1.04k stars 165 forks source link

Fire an event when the audio device that's in use in an AudioContext changes #2532

Open padenot opened 1 year ago

padenot commented 1 year ago

We can probably use "devicechange". This is useful, because changing the device can have problematic performance issue, because the block size, latency and channel count can change.

hoch commented 1 year ago

How is different from onsinkchange?

https://webaudio.github.io/web-audio-api/#dom-audiocontext-onsinkchange

padenot commented 1 year ago

This would be fired when the underlying device changes, not necessarily in reaction to setSinkId(...); having been called on the AudioContext.

It might be possible to reuse the even "sinkchange". It might be desirable to be able to distinguish a sink change because of setSinkId(...) and something external though, we need to think about it.

hoch commented 1 year ago

In 02/09 Teleconf:

@padenot suggested that there might be a tricky case where setSinkId() user call could happen almost at the same time of user plugging out an audio device from the system. We need to think about the order of events and how to handle this case properly.

hoch commented 9 months ago

2023 TPAC Audio WG Discussion: