Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detect Processes using Audio on Windows

Tags:

windows

audio

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?

like image 926
Agnel Kurian Avatar asked Jan 24 '23 13:01

Agnel Kurian


1 Answers

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.

like image 87
ReinstateMonica Larry Osterman Avatar answered Jan 26 '23 03:01

ReinstateMonica Larry Osterman