Tone.js icon indicating copy to clipboard operation
Tone.js copied to clipboard

Can't add Worklet module to Tone Context in FireFox

Open javieraizpuru opened this issue 2 years ago • 2 comments
trafficstars

After getting this error: #681 and changing the Tone Context to use a Tone.Context() object. I'm getting the error TypeError: can't access property "buffer", i[0][0] is undefined.

audioContext = new Tone.Context(); 
Tone.setContext(audioContext);
audioContext.addAudioWorkletModule('/js/phase-vocoder.js', 'phase-vocoder-processor');

The module used is phaze, but I don't think the problem is with the module since it works without ToneJS. I'm using Firefox Developer 117.0b9

javieraizpuru avatar Aug 19 '23 15:08 javieraizpuru

Looks like audioWorklet support in Tone on Firefox is broken, likely an issue with standardized-audio-context, might be fixed in tone@latest if you haven't tried it. But you can also work around it by using native code via the unwrapped context: audioContext.rawContext._nativeAudioContext.audioWorklet.addModule("/js/phase-vocoder.js").then(...)

marcelblum avatar Aug 20 '23 04:08 marcelblum

@javieraizpuru Is that a version of phaze which contains this fix? Could you please provide the stack trace of the error If you're already using the most recent version of phaze and Tone.js? Of course a minimal test case to reproduce the error would be even better.

chrisguttandin avatar Aug 20 '23 12:08 chrisguttandin