Created
January 14, 2013 09:11
-
-
Save 72lions/4528767 to your computer and use it in GitHub Desktop.
Creates an AudioBuffer from and ArrayBuffer
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
/** | |
* 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