rserota / wad

Web Audio DAW. Use the Web Audio API for dynamic sound synthesis. It's like jQuery for your ears.
MIT License
1.9k stars 160 forks source link

Can't set destination #51

Closed elad661 closed 8 years ago

elad661 commented 8 years ago

I'm trying to set destination when initializing my Wad object, but I'm getting an error: SyntaxError: An invalid or illegal string was specified. A quick google search tells me this happens if you try to link nodes from different audio contexts together.

The problem is, since I can't access Wad's own context (I can see where it's defined in wad.js, but I can't access it from a different js file for some reason), I can't create my node in from the same context.

If there was a way to access wad's context from other JS files, or to tell Wad to use my own context, then I could do what I want to do.

rserota commented 8 years ago

I pushed an update that addresses this issue. If you pull down the latest version of the code, the audio context that Wad.js creates is assigned to Wad.audioContext, so that you can access it from other scripts. I hope that helps.

elad661 commented 8 years ago

Awesome, thanks!