Created
September 16, 2014 05:27
-
-
Save MattRoelle/2a7ed3a925fb81db66e3 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var actx = new AudioContext(); | |
var sound = actx.createBufferSource(); | |
var req = new XMLHttpRequest(); | |
var audioFile = 'https://dl.dropboxusercontent.com/u/87705298/136351__djmastah__requiem-3.mp3'; | |
req.open('GET', audioFile, true); req.responseType = 'arraybuffer'; | |
req.onload = function() { | |
actx.decodeAudioData(req.response, function(buffer) { | |
sound.buffer = buffer; | |
sound.connect(actx.destination); | |
sound.start(); | |
}); | |
}; | |
req.send(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment