We used hooking to "isolate" the audio output from a certain application on Windows:<p>The application would ask the operating system for the default audio device. By intercepting this request, we were able to re-route it to our own, virtual audio device. Our program would then fetch the audio data from the virtual device, and replay it to the "real" audio device. At the same time, the audio gets saved to ram, and finally to disk.<p>The benefit of this method was that we were able to actually isolate the audio from all other sources on the computer. So you could, in theory, mute the playback, while still being able to let the recording run.
Ultimately, we abandoned this method, as it proved quite unreliable. But it was fun to come up with, and finally implement.