Created
September 21, 2013 19:58
-
-
Save amundo/6653652 to your computer and use it in GitHub Desktop.
A couple of changes to example4.html from this great article by Jos Dirksen (http://www.smartjava.org/content/exploring-html5-web-audio-visualizing-sound) are sufficient to get it running in Firefox Aurora.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38,39c38,40 | |
< // create the audio context (chrome only for now) | |
< var context = new webkitAudioContext(); | |
--- | |
> // create the audio context -- covers Firefox and Chrome | |
> var AudioContext = AudioContext || webkitAudioContext; | |
> var context = new AudioContext(); | |
70c71,73 | |
< javascriptNode = context.createJavaScriptNode(2048, 1, 1); | |
--- | |
> // createJavaScriptNode now called createScriptProcessor | |
> //javascriptNode = context.createJavaScriptNode(2048, 1, 1); | |
> javascriptNode = context.createScriptProcessor(2048, 1, 1); | |
109c112,113 | |
< sourceNode.noteOn(0); | |
--- | |
> //sourceNode.noteOn(0); // .noteOn renamed to .start | |
> sourceNode.start(0); | |
166d169 | |
< |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment