public void MuteUnmuteAppVolume() { var pid = ProcessesService.GetActiveProcessID(); if (!pid.HasValue) { return; } SetApplicationMute(pid.Value, !(GetApplicationMute(pid.Value) ?? false)); }
public void LowerAppVolume() { var pid = ProcessesService.GetActiveProcessID(); if (!pid.HasValue) { return; } var vol = GetApplicationVolume(pid.Value); vol = Math.Max(0, vol.GetValueOrDefault(0) - 5); SetApplicationVolume(pid.Value, vol.Value); }