Skip to content

Instantly share code, notes, and snippets.

@72lions
Created January 14, 2013 09:11
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 72lions/4528767 to your computer and use it in GitHub Desktop.
Save 72lions/4528767 to your computer and use it in GitHub Desktop.
Creates an AudioBuffer from and ArrayBuffer
/**
* Is triggered when a chunk is loaded
*/
var _onChunkLoaded = function() {
// Concat two ArrayBuffers into a new one
_activeBuffer = _appendBuffer(_activeBuffer, _request.response);
// Use decodeAudioData for creating an AudioBuffer,
// so that we don't block the main thread.
_context.decodeAudioData(_activeBuffer, function(buf) {
// Store the audiobuffer
_audioBuffer = buf;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment