Closed 432player closed 2 years ago
I'm just looking into setting this up (haven't tried myself yet) but this thread might help?
Recent updates to browsers require that worklets may only be loaded when running site under https. Example is not currently setup for this.
@cutterbl, Please, how to make this works using electron app? The documentation says that works (with hacks).
All the best!
import createSoundTouchNode from '@soundtouchjs/audio-worklet';
const setupContext = function () { audioCtx = new AudioContext(); return audioCtx.audioWorklet .addModule('./js/soundtouch-worklet.js') .catch((err) => console.log(err)); };
const setupSoundtouch = function () { if (soundtouch) { soundtouch.off(); } soundtouch = createSoundTouchNode(audioCtx, AudioWorkletNode, buffer); //This is the line which generates the Error soundtouch.on('initialized', onInitialized); };
Getting this when trying to run
[loadSource] DOMException: Failed to construct 'AudioWorkletNode': AudioWorkletNode cannot be created: The node name 'soundtouch-worklet' is not defined in AudioWorkletGlobalScope. at SoundTouchNode._createSuperInternal (webpack-internal:///48:153:24) at new SoundTouchNode (webpack-internal:///48:183:22) at createSoundTouchNode (webpack-internal:///48:524:10) at setupSoundtouch (webpack-internal:///45:131:100) at Object._callee$ (webpack-internal:///45:95:13) at tryCatch (webpack-internal:///47:62:40) at Generator.invoke [as _invoke] (webpack-internal:///47:296:22) at Generator.prototype. [as next] (webpack-internal:///47:114:21)
at step (webpack-internal:///45:6:191)
at eval (webpack-internal:///45:6:361)