Note that there are some explanatory texts on larger screens.

plurals
  1. POChrome tab crash on decodeAudioData
    text
    copied!<p>Trying to build a webgl audio visualizer with a small engine I made for column landscape which I thought would be great for a frequency distribution over time.</p> <p>Right now this, which is compiled from coffeescript, crashes the tab:</p> <pre><code>(function() { var context, loadSound, onError, playSound, soundBuffer, url; context = new webkitAudioContext(); soundBuffer = void 0; url = 'MoxxiTest.ogg'; loadSound = function(url) { var request; request = new XMLHttpRequest(); request.open('GET', url, true); request.responseType = 'arraybuffer'; request.onload = function() { context.decodeAudioData(request.response, (function(buffer) { soundBuffer = buffer; return console.log('hmmm'); }), onError); return console.log('hmmm'); }; return request.send(); }; playSound = function(buffer) { var source; source = context.createBufferSource(); source.buffer = buffer; source.connect(context.destination); return source.noteOn(0); }; onError = function(e) { return console.log(e); }; window.onload = function() { return loadSound(url); }; }).call(this); </code></pre> <p>From testing this is taking place in the decode audio data call of context in the loadSound function.</p> <p>Tested by using both a mp3 and an ogg of the same file. </p> <p>Following the tutorials at <a href="http://www.html5rocks.com/en/tutorials/webaudio/intro/" rel="nofollow">http://www.html5rocks.com/en/tutorials/webaudio/intro/</a> and <a href="http://www.smartjava.org/content/exploring-html5-web-audio-visualizing-sound" rel="nofollow">http://www.smartjava.org/content/exploring-html5-web-audio-visualizing-sound</a> for info on the web audio api</p> <p>I'm using XAMPP to get around the cross origin sharing policy if that makes a difference.</p> <p>Chrome version is: 22.0.1229.94 Thanks for the help!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload