Any easy way to export audio from ofSoundStream in realtime?

I want to export audio directly from ofSoundStream. It can be a raw audio file to import in Audacity later, just dump the audio buffer to a file, how can I do that?
Thank you,

Which OS are you using?

The simplest answer might be to just use a virtual loopback audio device (e.g. Soundflower) and record from an external program.

If you want to DIY by writing to a file at the same time audioOut() is being called, keep in mind that audioOut() happens on a different thread than update/draw, so there’s some threading concerns involved.

I’m using OS X and tried to output the buffer from audioOut but it seems to work only when I’m synthesizing the sound, not using ofSoundPlayer.
I’m afraid of soundflower the last time I used it weird caused issues on my trackpad
Thank you

Look at ofxVideoRecorder. It uses ffmpeg and its pretty solid provided its setup right and pretty easy to use. It should be able to record from a sound stream.

-Ryan

Hello Ryan, thanks, it worked in the scenes I’m synthesizing audio, but it doesn’t work when I’m using ofSoundPlayer.
Do you know some way of recording this audio using ofxVideoRecorder?
Thanks

It could possibly be that it isn’t set to the correct sample rate that the source is coming in at. Really, thats the only problem I’ve had with this addon is that it becomes very unhappy with unmatched sample rates. Past that, I’m really not sure.

Ryan

Just to update. I’ve write ofxVideoRecorder author and it is not possible at the moment to record ofSoundPlayer
You can see the explanation here: https://github.com/timscaffidi/ofxVideoRecorder/issues/14
Thanks