tenfourfox/dom/base/test/file_webaudioLoop2.html
Cameron Kaiser c9b2922b70 hello FPR
2017-04-19 00:56:45 -07:00

16 lines
325 B
HTML

<!DOCTYPE html>
<script>
var ac = new AudioContext();
fetch("audio.ogg").then(response => {
return response.arrayBuffer();
}).then(ab => {
return ac.decodeAudioData(ab);
}).then(ab => {
var src = ac.createBufferSource();
src.buffer = ab;
src.loop = true;
src.start();
src.connect(ac.destination);
});
</script>