Hope this helps any future googlers.
The only way to do this is to use a streaming audio library (for example, youtube-audio-stream for Node) and buffer / stream the audio from the server side.
var express = require('express');
var router = express.Router();
var youtubeStream = require('youtube-audio-stream');
router.get('/stream/:videoId', function (req, res) {
try {
youtubeStream(req.params.videoId).pipe(res);
} catch (exception) {
res.status(500).send(exception)
}
});
. AudioContext - , WebGL canvas (, pixi.js).
, :
function loadSound() {
var request = new XMLHttpRequest();
request.open("GET", "http://localhost:8000/stream/nl6OW07A5q4", true);
request.responseType = "arraybuffer";
request.onload = function() {
var Data = request.response;
process(Data);
};
request.send();
}
function process(Data) {
source = context.createBufferSource();
context.decodeAudioData(Data, function(buffer){
source.buffer = buffer;
source.connect(context.destination);
source.start(context.currentTime);
})
.
http://www.willvillanueva.com/the-web-audio-api-from-nodeexpress-to-your-browser/
: https://web.archive.org/web/20170715041035/http://www.willvillanueva.com/the-web-audio-api-from-nodeexpress-to-your-browser/