Recording the sound that is produced by a program is difficult because most sound cards do not support to use their sound output as a sound-input for recording.
However, there is a hardware workaround:
What may work is to connect the "Line-Out"-Jack with the "Line-In"-Jack
of your sound card with a 1:1 connected Stereo cable, possibly with a
galvanic separation device in between.
Please do not connect "Line-Out" with the "Microphone"-Jack because the microphone outputs a power-supply for the microphone and if you connect that power-supply with the Line-Out, you may damage your sound-card. (The "Mic"-jack uses a Stereo-connector but only supports Mono-microphones. The other channel is used for the power-supply. )
Hope this helps,
P.S.: Future versions of DemoRecorder may also support direct capturing of sound-output at a software level before it reaches the sound card. As of now I do not know whether this is possible but I must admit that I didn't do extensive research into that direction. What I can tell is that there is no obvious solution for software-based capturing of sound output.
A possible alternative solution would be direct interfacing between your application and DemoRecorder. We provide a custom development service, so you can order some customizations of DemoRecorder which are needed for that purpose.
Interview on the Linux Link Tech Show. Please select Episode 154.
DemoRecorder featured in Linux-User Magazine (in German)