instantly play remote wav streams using fetch API + WebAudio
No latency wav stream player using browser fetch streaming API and WebAudio
Tested on Chrome and Firefox 57+ with some flags on.
Example : http://revolunet.github.io/webaudio-wav-stream-player
Based on @chrisguttandin and @revolunet work
import WavPlayer from 'webaudio-wav-stream-player';
let player = new WavPlayer();
player.play('http//domain/path/to/stream.wav');
player.stop();
// proxy /proxy/http://path/to/stream.wav
app.get('/proxy/*', function (req, res, next) {
let remoteReq = request.get(req.params[0]);
req.on("close", function() {
remoteReq.abort();
res.end();
});
req.pipe(remoteReq).pipe(res);
});