Closed ghost closed 2 years ago
Hi @IRod22, I tried to reproduce the issues with your example on StackBlitz but it worked as expected for me.
Can you please double check if it is a problem with standardized-audio-context or with Tone.js by setting the AudioContext
used by Tone.js to the native AudioContext
?
https://tonejs.github.io/docs/14.7.33/fn/setContext
I think the following should work:
Tone.setContext(window.AudioContext);
I just tried that on my Windows machine, and the browser gave me the following error:
TypeError: Ii.resume is not a function
I'll have to get you the call stack later (currently offline), but I can tell you that it happend in the following snippet (pretty-printed as I was using the min.js version):
function Pi() {
return Ii.resume()
}
I will report this to Tone.js as well.
The snippet that I posted above is wrong. Sorry for that. It should be an instance of an AudioContext
and not the constructor.
Tone.setContext(new window.AudioContext());
Got a new error: that is much deeper in the call stack. I'll get a "dev" version of Tone.js once I get back online to comb through the call stack.
I updated your example on StackBlitz. It works without throwing any errors for me in Chrome.
https://stackblitz.com/edit/tonejs-issue-playing-and-timing-cqqyoj
It fails in Firefox and for sure in Safari. That's why Tone.js uses this library. :-) But I thought the bug that you are reporting only happens in Chrome.
It happens in Firefox (desktop and Android), Chrome for Android, and Samsung Internet. This is why I created this issue here to see if this library is the root of the bug. See the original issue thread for details.
Yes, I looked at the other issue that's how I got to know that it's a Chrome only issue. The original bug says it happens in Firefox but later one you wrote:
This testing allows me to conclude that this is either with the Tone.js API, or with the Web Audio API on Chromium-based browsers.
Sadly I have no way to reproduce the issue. It works as expected for me in Firefox, too.
Wow. We may need to have the community chime in to reproduce the bug on their machines. What's strange to me is that I tested this out on two different devices, one relatively old and one relatively new, and the issue still cropped up on different browsers.
I'm going to close the issue over here. The problem isn't solved yet but I think it's confusing to have the same conversation twice.
tonejs/Tone.js#1096
I am having a potential issue with this library, which links to Tone.js, particularly with Tonejs/Tone.js#1096. In that issue, I pinpointed the bug to either be in Tone.js or this library; that is why I'm here to see if this package is what is making Tone.js sound glitchy and off beat.