views:

175

answers:

3

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?

+1  A: 

Hello,

Download process explorer from sysinternals (Microsoft). Once installed and in the interface click "find" "find handle or DLL"

In Vista I put in audioses.dll (Audio Session) and audioeng.dll (Audio Engine)

Either one will bring up a list of apps that can/do use the sound card.

Thanks, -Mathew

Mathew
+3  A: 

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.

Larry Osterman
do these include apps using with waveOut or DirectSound APIs?
Mark Heath
If they're playing uncompressed audio, yes.
Larry Osterman
A: 

You don't need process explorer.
Just enumerate the handle table from ring3 (old FAQ, Google groups, Win32)

Some of the API's mentioned, such as ASIO, cannot be found this way. Not all knowledge comes from old FAQs. Buy some new books.
Robert Harvey