cutterbl / soundtouchjs-audio-worklet

AudioWorkletNode and AudioWorkletProcessor implementing SoundTouchJS
GNU Lesser General Public License v2.1
70 stars 10 forks source link

Unable to make this work, can anyone help? Please #6

Closed 432player closed 2 years ago

432player commented 3 years ago

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)

naomiaro commented 3 years ago

I'm just looking into setting this up (haven't tried myself yet) but this thread might help?

https://github.com/webpack/webpack/issues/11543

cutterbl commented 2 years ago

Recent updates to browsers require that worklets may only be loaded when running site under https. Example is not currently setup for this.

lannodev commented 1 year ago

@cutterbl, Please, how to make this works using electron app? The documentation says that works (with hacks).

All the best!