add audioWorklet. How? #968
Unanswered
artofmus
asked this question in
Answers & Questions
Replies: 1 comment
-
|
you get the contents of the attachment in attachments.your_file, i guess if addModule needs a url your best bet to make this also work in the exported patch is to create a data-url from the content and then replace "white-noise-processor.js" with that. https://cables.gl/docs/5_writing_ops/dev_attachments/dev_attachments |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Friends! I can't figure out how to use audioWorklets. I make a separate .js file for the processor to create white noise, add it via create attachment, but judging by the console, the cables can not find the file, how to add files correctly? This is code.
const audioCtx = CABLES.WEBAUDIO.createAudioContext(op);
const audioOut = op.outObject("audio out", null, "audioNode");
audioCtx.audioWorklet.addModule("white-noise-processor.js").then(() => {
const whiteNoiseNode = new AudioWorkletNode(audioCtx, "white-noise-processor");
audioOut.set(whiteNoiseNode);
});
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions