Thank you hahakid! I solved it like so:
ofImage img;
img.grabScreen(0, 0, ofGetWidth(), ofGetHeight());
vidRecorder.addFrame(img.getPixels());
Now I have problems recording the audio. My code looks like this:
void ofApp::audioOut(ofSoundBuffer &buffer) {
auto b = buffer.getBuffer();
vidRecorder.addAudioSamples(&b[0], b.size(), buffer.getNumChannels());
}
Problem is that the audioOut(...)
is not called. This is how I initialise my ofSoundPlayer
:
player.load("gold.mp3");
player.setVolume(0.75f);
player.play();
I guess I have to connect the player to ofApp. Am I on the right track here?