Prototype:
Confirmed for Chrome above works. Jacob_ might want to add UI features to this though. Only works with .ogg, never mind what I said before.
Code:
var chunks = [];
var ac = window.audioSystem.audioContext;
var dest = ac.createMediaStreamDestination();
var mediaRecorder = new MediaRecorder(dest.stream);
//connect all the nodes
for (var i in window.audioSystem.gainNodes) {
var gn = window.audioSystem.gainNodes[i];
gn.connect(dest);
}
//start at song start
mediaRecorder.start();
window.song.play(0);
//stop at song end
function stop() {
window.song.stop();
mediaRecorder.stop();
}
setTimeout(stop, window.song.loopTime * 15000 / bpm);
mediaRecorder.ondataavailable = function(evt) {
// push each chunk (blobs) in an array
chunks.push(evt.data);
};
mediaRecorder.onstop = function(evt) {
// Make blob out of our blobs, and open it.
var blob = new Blob(chunks, {type: 'audio/ogg; codecs=opus'});
document.write('<audio controls></audio>');
document.querySelector("audio").src = URL.createObjectURL(blob);
};
Kim Wrote:##878337 + https://js-game.glitch.me + Doesnt take peopel serious if their has badly speling gramer puntuatin