ofSoundBuffer vs ofxLibsndfileRecorder for record/playback/save

So I’ve managed to hack together a little tool for recording x Frames (5) of audio at a given Framerate (25) using the awesome ofxLibsndfileRecorder for recording, playback and saving. Works fine on my laptop (2014 MBP 10.8.5) and on an old 2006 MB (10.6.8), however testing on another machine, it never manages to write the temp.wav file needed for everything to work.

I moved my temp.wav file to ‘…/’ of the data folder- since that was the first issue I found when moving the binary to the desktop… perhaps the data folder is intended for reading only? I had thought of storing this temp.wav file in the ‘~/Documents/appname’ path- but couldn’t get ofxLibsndfileRecorder to recognize or find that path for saving to.

In the end, it’s surely wasting hard drive space and speed by even storing audio in this temp.wav file. The main question is- how do I go about moving this temp audio to the buffer?? I’ve been combing these forums and google for examples using the ofSoundBuffer (having found the ofSoundBuffer .h + .cpp here) along with some documentation here - nevertheless, I’m wondering if ofSoundBuffer is even designed for this setup? I now see there is an ofBufferSound example in the works… however it’s based on generative sound, rather than recorded, sampled/playedback, and exported/saved. Are those possible with it… could someone offer some guidance [even minor snippets for C++ issues that might not be obvious]? Experienced in Processing and slowly gaining ground in oF.

The code thus far for the project can be found here: audioFrames

OK… randomly changed my strategy in saving this file, to research how to save it internally or if there were guides for why my data folder wasn’t being embedded into the binary and found the perfect solution here.

Perhaps it’s already in the works, but I would highly suggest considering this setup/code to be embedded within the next oF release (no idea what it might conflict with) and Project Generator– since it follows the same logic one experiences coming from Processing; the data folder holds all the goodies and gets copied when compiling.

Still curious for speed/resource purposes if it’s possible or even useful to do everything in the buffer, but for now all is good.