Skip to content

Instantly share code, notes, and snippets.

@amundo
Created September 21, 2013 19:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save amundo/6653652 to your computer and use it in GitHub Desktop.
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.
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