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
Tighten spec on ABSN output channels? #1481
Comments
The following example demonstrates that Chrome does set the output channel count when the AudioBuffer is assigned, but resets to mono (or zero channels) when the ABSN stops. I wouldn't argue that the spec should be changed just to enshrine implementation bugs in perpetuity, but this may be useful for avoiding unnecessary up-mixing when ABSNs with large numbers of channels are not playing and not explicitly disconnected. The same benefit would exist before and after the ABSN is playing.
|
Thanks for the nice test code! Since it appears the GC observability issue is gone, perhaps there's nothing that needs to be done here. It's an optimization for the browser to do if desired? |
I suggest leaving this open as an option at least until the solution to The spec is currently clear that that ABSN always and indefinitely With this behavior, I don't see much optimization possible for multiple identical Still, this is an option to resolve some of the optimization concerns people |
I think, as an optimization, that when |
An ABSN that has a buffer, but for which start() has not been called, would |
Fix #1481: ABSN outputs mono silence when stopped
Specify that when an ABSN is done playing the number of channels in the output is one, instead of the number of channels in the `AudioBuffer`. Update the playback algorithm as well.
This is follow up from #1471 (comment).
I think the proposal there is that ABSNs output exactly one channel of silence until the buffer starts playing and when the buffer stops playing (if ever), the node produces again a single channel of silence.
The difficulty with this is if the ABSN is scheduled to start in the middle of a render quantum. It seems impossible to change the channel counts at that point, so the count has to happen at the render quantum before or after the the start time. Stopping the source has exactly the same problem.
I think Chrome sets the output channel count when the AudioBuffer is assigned.
The text was updated successfully, but these errors were encountered: