Getting process id of playing application

Apr 15, 2011 at 6:44 PM

Hi,

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 15, 2011 at 11:00 PM

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

Coordinator
Apr 16, 2011 at 7: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?

Mark

Apr 18, 2011 at 3: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!

Coordinator
Apr 18, 2011 at 4: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

Mark