public static float?GetSystemSoundsVolume() { Interfaces.ISimpleAudioVolume volume = GetSystemSoundsVolumeObject(); if (volume == null) { throw new Exception("No session found for system sounds"); } float level; volume.GetMasterVolume(out level); Marshal.ReleaseComObject(volume); return(level * 100); }
public static float?GetApplicationVolume(int pid) { Interfaces.ISimpleAudioVolume volume = GetVolumeObject(pid); if (volume == null) { throw new Exception("No application found for pid"); } float level; volume.GetMasterVolume(out level); Marshal.ReleaseComObject(volume); return(level * 100); }