jsbeeb
jsbeeb copied to clipboard
Recording audio
I have some old music created using the Quicksilva MuProc.
The MuProc runs surprisingly well in the browser. But I'd really like to be able to record the output somehow.
Any ideas about whether this would be possible? Is it possible to tap into the generated audio-stream and save it to an AudioBuffer somewhere? (Are you using Web_Audio?)
If so, where (in the code) might I look to experiment with this?
Hi @interstar ! Cool stuff :) The code is pretty self-contained, and you can save data with window.saveAs() in Javascript:
https://github.com/mattgodbolt/jsbeeb/blob/master/soundchip.js#L181 is where the sound is "rendered", called periodically to provide more data to the browser. That's called from code at https://github.com/mattgodbolt/jsbeeb/blob/6f8625358da66abe63b4032017b1b11f160fc61f/main.js#L161 which does all the audio stuff (JS AudioContext).
Storing all the sound output additionally in a big buffer at line 169 in main.js might do the trick.
Cool.
Thanks @mattgodbolt
I'll start having a play around. :-)