You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From what I understandimportScripts would add scripts to the "WorkerGlobalScope", but the AudioWorkletGlobalScope docs mention nothing about being associated with the WorkerGlobalScope leading me to understand that they're two different things. There's no mention in any WebAudioApi docs about importing scripts so my question is how can I go about importing scripts into an audioWorklet?
If that's not possible, is there anyway I can give my audioWorklet an arbitrary function that it's suppose to use?
The text was updated successfully, but these errors were encountered:
This is intentional. You can use import (aka static imports), but it's sub-optimal, since it's going to do unnecessary work on the real-time thread that you can easily avoid. I would recommend against it. The difference is that I don't think static import can be disabled in a worklet, because they're part of the ES Module syntax.
It's best to prepare your source file ahead of time and load that, if you want to do things at runtime, or you can use a packer if you already have a build step in your project. I've pointed to a code example on the slack channel, where you've asked the question, happy to talk about this there.
Describe the issue
I can't use
importScripts
in my audioWorkletFrom what I understand
importScripts
would add scripts to the "WorkerGlobalScope
", but the AudioWorkletGlobalScope docs mention nothing about being associated with the WorkerGlobalScope leading me to understand that they're two different things. There's no mention in any WebAudioApi docs about importing scripts so my question is how can I go about importing scripts into an audioWorklet?If that's not possible, is there anyway I can give my audioWorklet an arbitrary function that it's suppose to use?
The text was updated successfully, but these errors were encountered: