This project has moved and is read-only. For the latest updates, please go here.

Getting process id of playing application

Apr 15, 2011 at 7:44 PM


I just found NAudio, it seems like a very nice wrapper around an annoying COM interop.
Is there any way to get the process id of the process that is playing sounds? Like the Win7 mixer that is showing a volume bar per process?


Thank you!@

Apr 16, 2011 at 12:00 AM

I noticed that NAudio has CoreAudioAPI inside - which supports it (with IAudioSessionManager2) in CodeProject - can NAudio integrate the latest CoreAudioAPI?

Apr 16, 2011 at 8:25 AM

hi, I don't know about the process ID, you might be best asking on a forum where there are some WASAPI experts. NAudio doesn't have IAudioSessionManager2 wrappers, but it sounds like something that would be useful. Fancy submitting a patch?


Apr 18, 2011 at 4:51 PM

Hi Mark,

NAudio is yours? Awesome work!

I used the CoreAudioAPI from codeproject to enumerate audio sessions, it works.

If I end up using NAudio for something, I will definitely try to incorporate IAudioSessionManager2.
I found NAudio because I originally intended to record individual sessions (like only record from a certain PID), but I realized it's a pipe dream.

Thank you!

Apr 18, 2011 at 5:13 PM

yes, its unfortunate that the CoreAudio API blocks you from getting at the audio from certain processes. I guess its to avoid the legal issues of people ripping the audio output of media players