rserota / wad

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

Fix for react by not setting globals #62

Closed mattbierner closed 8 years ago

mattbierner commented 8 years ago

Fixes two issues when using this library with webpack and react:

rserota commented 8 years ago

Thanks for your interest in Wad.js! However, something doesn't seem quite right in this code that you changed. When I load up your fork in the GUI application (in the GUI folder), I'm unable to get microphone access. There's an error in the console: wad.js:2530 Error setting up microphone input: TypeError: Illegal invocation

It's possible that I'm having problems because the function navigatorGetUserMedia is no longer a property of the navigator object. In past versions of Wad.js, I used Function.prototype.bind to avoid assigning to the window or navigator, while still retaining the link between navigator and getUserMedia.

mattbierner commented 8 years ago

Thanks for taking a look. There were two problems with the this binding that should be fixed now, although I wasn't able to get the GUI example app to do much more than produce some horrible shrieking sound, even on the master branch.

Let me know if there are any instructions for testing.

rserota commented 8 years ago

That horrible shrieking sound was probably just microphone feedback (sound goes in your mic, out your speakers, and right back into your mic, which causes the audio signal to amplify rapidly). If you use headphones, or an external microphone, you probably won't get such bad feedback.

There aren't really any instructions for testing, but there should be. I usually just load up the GUI app and make some quick loops, making sure that microphone and MIDI access work.

Thanks for contributing!