Audio Mixer "Per Application" in Windows XP

I need to mute and unmute other processes in Windows XP. I am looking for the best strategy. Is it possible to write a kernel mode mixer that will filter inputs to an output device? My other approach would be to install Hooks for various APIs to intercept their Win32 calls. I would prefer a less invasive approach.

Some considerations: Coverage for applications using WinMM and DirectSound system components will probably be sufficient (i.e. I don't need to worry about other audio interfaces).

This will ultimately need to be used from within a C # application. I am competent enough at interop, but have no internal knowledge of Win32 to make this happen.

One could list all the applications to be disabled and approach each application separately, although the list is expected to grow.

PS In case someone is interested, these operations will be performed with the consent of the users (no shadow business).

+2


source to share


1 answer


The problem with kernel mode drivers is that they generally do not support the process. This is part of a clean layered architecture. Responsibility for the processes lies with the OS itself. The sound driver must handle audio. Now the mixer should definitely handle multiple audio streams and might give them unequal weight, but it shouldn't care much about where it came from. Also, the built-in mixer is not intended to be a replacement, so you will have to intercept audio streams before mixing them.

For this reason, it makes much more sense in XP to use Microsoft Detours to intercept calls at the API level. You have information about the calling process. Workarounds mostly inject assembly into custom parts of the OS, so I would advise using C ++ rather than C # with Detours.



As I understand it, on Vista the audio is rewritten so that you can associate audio streams with applications, but this is a system-wide feature.

+1


source







All Articles