Add AudioNode hooks to support additional AudioContext cases#67
Open
mikejhill wants to merge 5 commits intorain-fighters:mainfrom
Open
Add AudioNode hooks to support additional AudioContext cases#67mikejhill wants to merge 5 commits intorain-fighters:mainfrom
mikejhill wants to merge 5 commits intorain-fighters:mainfrom
Conversation
Member
|
I just wanted to let you know that I have seen your PR. I just hadn't the time yet to test your patch and -- assuming it works -- merge it into main and make a new release. Thanks! |
Author
No worries! Let me know if there is anything I can do to support. |
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR replaces the
AudioContextfactory-based hooks withAudioNode#connecthooks. This supports additional cases, including constructor-basedAudioNodecreation (rather than factory-based) and after-page-load extension functionality throughAudioContext#resume.Factory methods are not deprecated, but their constructor alternatives are recommended. Per commentary in MDN (https://developer.mozilla.org/en-US/docs/Web/API/AudioNode#creating_an_audionode):
The original PR intent was to support
BaseAudioContext.createBufferSource(MDN), such as on myNoise.net. However, diving in after seeing MDN's constructor recommendation, it seems thatAudioNode#connectto connect to anAudioContext#destinationis a hard requirement of the Web Audio API (reference: https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API), and thus this change should hopefully cover all remainingAudioContextcases not supported by the current implementation.Tested sites so far appear to all be working as expected:
I'm not aware of other
AudioContextcases in the wild, but would love to validate on more if we have other samples.