Connect with external WebAudio Context / Analyser

Tags: #<Tag:0x00007f250cf82838>

Hello

I’m very excited in discovering Cables.
I’m coming from three.js (but have a long background, going from gephex, to a lot of different apps).

Anyways, less about me … More about Cables !!

Is there a not-too-hacky way to use an external WebAudio Context, or directly an Analyser from webAudio ?

So i guess i’d write my cables patch from the GUI, then after when embedding, i’d link with the existing WebAudio context, instead of creating a new one in Cables.

I looked around, but couldn’t find any documentation on this … i’ll start hacking away, but i’m sure there’s an “official” way of doing it :stuck_out_tongue:

Take care
L

Maybe something here could help.

Alright, all done.

For future reference.

To embed a Cables patch in a webpage. BUT i want it to use an existing AudioContext and not have Cables create one :slight_smile:

In your patch, do this :
Annotation%202020-01-24%20171241

In The webpage, in the callback function for patchFinishedLoading i’m doing :

let myVar = CABLES.patch.getVar("ExternalAudio");            
if(myVar)
myVar.setValue(myAudioNode);

And before calling your cables patch, make sure you do this :

window.audioContext = MyPreviousAudioContext

And you’re all done :slight_smile:

Nice!