Skip to content

Instantly share code, notes, and snippets.

View molzieyy's full-sized avatar
🎯
Focusing

Molel Levy molzieyy

🎯
Focusing
View GitHub Profile
@molzieyy
molzieyy / web-audio-fetch-stream.js
Created January 21, 2019 07:02 — forked from revolunet/web-audio-fetch-stream.js
Web Audio streaming with fetch API
//
// loads remote file using fetch() streams and "pipe" it to webaudio API
// remote file must have CORS enabled if on another domain
//
// mostly from http://stackoverflow.com/questions/20475982/choppy-inaudible-playback-with-chunked-audio-through-web-audio-api
//
function play(url) {
var context = new (window.AudioContext || window.webkitAudioContext)();