JSFiddle - React, Tailwind, and code Playground
by josekerekes
JavaScript
var getSound = new XMLHttpRequest();
var audiobuffer;
getSound.open('get','http://www.w3schools.com/tags/horse.ogg',true);
// true for asyncronous
getSound.responseType = "arraybuffer";
// arraybuffer general container for binary data
getSound.onload = function() {
audioContext.decodeAudioData(getSound.response,function(buffer){
audiobuffer = buffer;
})
}
getSound.send();