-
Notifications
You must be signed in to change notification settings - Fork 991
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
Tone.js Audio Context instanceof AudioContext returns false #1298
Comments
You probably want rawContext or in some cases |
Sorry, I forgot to mentioned I did try rawContext as well
Doesn't work either |
If I go to https://tonejs.github.io/ and put |
Thanks for the tip. Because I needed to create a new context anyways with 48000Hz sample rate, I tried creating a new Context from Tone.js Typescript complains:
Bypassing this error still creates the new context tho.
However, weird enough,
Anyways, it's working, but the behaviour mentioned above is kind of weird |
An update on the issue, the above solutions no longer work for some reason that I could not fathom. Creating new a standardized-audio-context, or a rawContext constructor, annd passing the new context to
The deployed versions of the site which worked before, now fails with the same error, so it shouldn't be a version upgrade issue. |
Describe the bug
I'm using this library https://github.com/GoogleChrome/omnitone to create an ambisonic decoder in the Tone.js AudioContext and it fails. Upon looking the code of the library I found that it uses instanceof to check and make sure it's an "AudioContext"
I'm using version Tone.js 15.1.3
Tone.js context does not return true in when it's tested if it's a prototype of AudioContext
To Reproduce
I tried to run the following, and they all return false
Expected behavior
The above should return true so it is recognized as an AudioContext
What I've tried
I thought it was an issue with standardized-audio-context, but I tried passing the AudioContext created directly from standardized-audio-context and it works. Then I went on to pass the new context to Tone.js, but I had to ignore the typescript error there. (This might be another issue?)
Thanks.
The text was updated successfully, but these errors were encountered: