Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
padenot opened this issue Jan 12, 2023 · 4 comments
Open
Labels
category: new feature Substantive changes that add new functionality. https://www.w3.org/policies/process/#class-4

Comments

@padenot
Copy link
Member

padenot commented Jan 12, 2023

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.

@padenot padenot added the category: new feature Substantive changes that add new functionality. https://www.w3.org/policies/process/#class-4 label Jan 12, 2023
@hoch
Copy link
Member

hoch commented Jan 17, 2023

How is different from onsinkchange?

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

@padenot
Copy link
Member Author

padenot commented Jan 26, 2023

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
Copy link
Member

hoch commented Feb 9, 2023

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
Copy link
Member

hoch commented Sep 13, 2023

2023 TPAC Audio WG Discussion:

  • Use sinkchange event for a platform-orignated callback when there is a change in the system device registry.
  • Set sinkId property under AudioContext to the empty string ("") when there’s no audio device to fallback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: new feature Substantive changes that add new functionality. https://www.w3.org/policies/process/#class-4
Projects
None yet
Development

No branches or pull requests

2 participants