How can i gain access to the current wave output sample stream?
In a December 2006 question on social.microsoft.com (How to record from 'Wave' or 'Stereo Mix' in Vista?) yjslash asked:
On Windows XP or earlier, I could capture the audio stream to the speaker. In other words, DirectSoundCapture was able to capture from the selected source line. And if "Wave Out Mix" or "Stereo Mix" or something similar was selected as recording source line, DirectSoundCapture was able to record the audio stream to the speaker.
To which Larry Osterman (MSFT) (audio team dev and StackOverflow user) responded:
What APIs did you use for this in XP? They should continue to work on Vista.
WASAPI has a special Loopback mode that allows a client to capture the post-mix audio stream, that may help as well
A question on Stackoverflow (How do I read system audio output in windows xp and windows 7?) also mentions that the WASAPI has the ability to sample the output mix, and that it's available starting with Windows Vista.
A January of 2007 a Windows Team blog entry mentions the ability to sample the audio output (for the purposes of echo cancellation; and what effect HDCP will have on it):
Will echo cancellation work less well for premium content?
We believe that Windows Vista provides applications with access to sufficient information to successfully build high quality echo cancellation functionality.
What API is used to sample the audio output? What access does Vista provide applications to do access the current audio output stream? What functions, and how to use them, of the WASAPI allows sampling/capture of the current audio output?
See also
I found this (Loopback Recording) in MSDN, and also this (Capturing a Stream).
By the way, according to MSDN, WASAPI will not allow you to capture streams with DRM protection:
Windows Vista provides digital rights management (DRM). WASAPI does not permit loopback recording of digital streams that contain DRM-protected content. Similarly, a trusted audio driver does not permit a loopback device to capture digital streams that contain protected content. Windows Vista allows only trusted drivers to play protected content. For more information about trusted drivers and DRM, see the Windows DDK documentation.
来源:https://stackoverflow.com/questions/5808287/windows-vista-7-how-to-sample-output-audio-mix