How do I detect which processes are playing audio on my Windows machine? In other words, how do I enumerate processes which are using my sound card?
On Windows 7, there are APIs that will allow you to enumerate all the audio sessions on the machine, you can use these to enumerate the processes which are currently (or have recently) played audio.
There are some serious caveats to this. For instance you can't discover applications using 3rd party audio stacks like ASIO and you can't detect applications rendering compressed audio (using exclusive mode). But for a significant (98%?) of the apps, you can use the IAudioSessionManager2 interface to retreive a session enumerator which will let you enumerate the apps which are rendering (or have rendered recently) audio in shared mode.
Unfortunately this functionality is Windows 7 only.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With