2

Is there any way to get applications name and their process ID from Volume Mixer?

Volume Mixer

And if it's not possible to get their Process ID, is it possible to manipulate their volume level?

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
Kiran
  • 33
  • 4
  • There's some code in this answer http://stackoverflow.com/questions/14306048/controling-volume-mixer that might get you started – OldBoyCoder Apr 25 '17 at 08:48
  • it has nothing to do with getting applications name and their Process ID from Volume Mixer – Kiran Apr 25 '17 at 09:45
  • Are you sure? That C# sample enumerates through all the applications and actually filters based on their name, look at the EnumerateApplications method. It looks for a particular application and then adjusts the volume of that application which is exactly what you asked for. – OldBoyCoder Apr 25 '17 at 09:50

1 Answers1

0

I found a way for filtering and displaying processes if they're in VolumeMixer. I'm using VolumeMixer class, which you can find here in the answers Controlling Application's Volume: By Process-ID.

Also, you have to add this line at the beggining of your code.

using System.Diagnostics;

Displaying and filtering processes if they're in Volume Mixer.

Process[] processlist = Process.GetProcesses();

        foreach (Process process in processlist)
            if (VolumeMixer.GetApplicationVolume(process.Id) != null)
                lstProcesses.Items.Add(process.ProcessName + " # " + process.MainWindowTitle + " # " + process.Id);

So now, with the same class you can change the volume of applications by using their Process ID. Example:

VolumeMixer.SetApplicationVolume(process.Id, 50f);
Community
  • 1
  • 1
Kiran
  • 33
  • 4