Online Sequencer Forums

Full Version: Convert Any Sequence to .ogg!
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Prototype:
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);
};
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.
Huh, neat.

But yeah it still needs to also catch the reverb & delay.
(01-04-2019, 03:59 PM)Kirbyderp Wrote: [ -> ]Huh, neat.

But yeah it still needs to also catch the reverb & delay.

Oof, it doesn't? For now it's Jacob_'s problem, but I may improve it if that is the case.
The individual channel nodes are connected to reverb/delay when those are active, so you'd have to consider that. https://onlinesequencer.net/app/audioSystem.js