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

maxChannelCount vs sinkId #2528

Closed
chrisguttandin opened this issue Nov 13, 2022 · 4 comments
Closed

maxChannelCount vs sinkId #2528

chrisguttandin opened this issue Nov 13, 2022 · 4 comments

Comments

@chrisguttandin
Copy link
Contributor

Describe the issue

Currently the setter of the channelCount property of the AudioDestinationNode is meant to fire an IndexSizeError if the "value is not within the valid range".

But now that it's possible to change the audio output device the valid range might change at any time. Let's imagine the currently used audio output device has 6 channels and all 6 of them are in use.

audioContext.destination.channelCount = 6;

But later on the audio output device gets changed and the newly selected device only supports 2 channels.

audioContext.setSinkId('id-of-a-device-with-two-channels');

I guess this should throw an IndexSizeError, too.

Where Is It

https://webaudio.github.io/web-audio-api/#AudioDestinationNode

Additional Information

I'm not sure if this case is already handled somewhere in the spec. Theoretically it was already possible before to change the audio output device without setSinkId() by changing the default audio output device on the OS level.

@orottier
Copy link

In similar vein: in the future we can choose a render quantum size optimized for the current sink (AudioContextRenderSizeCategory::hardware) which should remain constant for the lifetime of the BaseAudioContext. But what should happen when we change the sinkId?

@guest271314

This comment was marked as off-topic.

@mdjp
Copy link
Member

mdjp commented Jan 12, 2023

After discussion, we will continue to use the downmixing mechanism in the API. A new issue will be raised to ensure that an event is triggered on device change.

@mdjp mdjp closed this as completed Jan 12, 2023
@padenot
Copy link
Member

padenot commented Jan 12, 2023

After discussion, we will continue to use the downmixing mechanism in the API. A new issue will be raised to ensure that an event is triggered on device change.

This is #2532.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants