jsbeeb icon indicating copy to clipboard operation
jsbeeb copied to clipboard

Recording audio

Open interstar opened this issue 8 years ago • 2 comments

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?

interstar avatar Jul 18 '17 23:07 interstar

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.

mattgodbolt avatar Jul 19 '17 13:07 mattgodbolt

Cool.

Thanks @mattgodbolt

I'll start having a play around. :-)

interstar avatar Jul 19 '17 14:07 interstar