Closed homerjam closed 3 years ago
Hi @homerjam, thanks for your contribution.
Do you know which nodes trigger that error? Could that be related to Tonejs/Tone.js#813?
This was the error - on closer inspection createStereoPanner
was called via new PitchShift()
. It could be related to Tonejs I suppose but similar issues I found when googling suggested it would be more likely "fixed" here..
I'm not sure if I can follow along. When setting the destination to a fixed channelCount of 1, wouldn't that make a StereoPanner unusable as well? It might not throw an error anymore but it will output mono, right?
Yes, that's right. As far as I can tell that's simply a limitation of iOS's implementation of AudioContext. Maybe it'd be worth pointing that out too though.
Ah maybe this explains it better https://stackoverflow.com/questions/52809552/how-to-pan-audio-in-ios-web-audio-implementation
Where do you think this polyfill would be best placed?
There is already a polyfill in this library for the missing StereoPannerNode.
Do the latest changes released as v25.1.8 make any difference for you? Is there a chance that you enabled what Safari calls the "Modern WebAudio API"?
Thanks for helping out here.
Unfortunately I seem to have a new issue with v25.1.8. This effects Chrome and iOS (the error is the same in both) which may indicate that the the original issue has gone away.
This error is caused by a check within Tone.js. I think it's most likely a side effect of having two different versions of standardized-audio-context running on the same page. Is that possible?
Ah yes, that was the case - I was importing standardized-audio-context
explicitly as well as Tone.js. However in the codepen below this seems to be a requirement to make iOS work (with the explicit channelCount workaround).
Since removing that I still face the original issue but now there's another problem even when trying to suppress the issue with the workaround.
I've created a codepen which shows the problem. Check the console to see the new error in Safari.
Also note the original createStereoPanner problem if you comment out lines 17 + 18.
It seems to work with Tone v14.7.76 which is the latest dev version. I created a little example based on yours: https://stackblitz.com/edit/typescript-jtgkme
That's done it! I'm not sure whether it's the new version or if it's seeing how I should have been using Tone in my example - but either way thanks so much for your help on this!
Hello!
I came across this bug via Tone.js. Obviously it's a Safari issue (surprise, surprise) but this seems like a good place to provide some help as I'd imagine this project is widely depended on.
Thanks!