public async Task <bool> SetAudioMute(Guid guid, bool mute) { CoreAudioDevice device = GetDeviceByGuid(guid, mediaPlayback); if (device == null) { return(false); } return(await device.SetMuteAsync(mute)); }
private void Window_KeyDown(object sender, KeyEventArgs e) { #if DEBUG if (e.Key == Key.Escape) { App.Current.Shutdown(); } #endif if (e.Key == Key.F11 && WindowState != WindowState.Normal) { WindowState = WindowState.Normal; WindowStyle = WindowStyle.SingleBorderWindow; } else if (e.Key == Key.F11 && WindowState == WindowState.Normal) { WindowState = WindowState.Maximized; WindowStyle = WindowStyle.None; } #if DEBUG if (e.Key == Key.F12) { isActiveSoundKeys = !isActiveSoundKeys; } #endif else if (e.Key == Key.VolumeMute && isActiveSoundKeys) { defaultPlaybackDevice.SetMuteAsync(!defaultPlaybackDevice.IsMuted); } else if (e.Key == Key.VolumeUp && isActiveSoundKeys) { defaultPlaybackDevice.SetVolumeAsync(defaultPlaybackDevice.Volume + 1); } else if (e.Key == Key.VolumeDown && isActiveSoundKeys) { defaultPlaybackDevice.SetVolumeAsync(defaultPlaybackDevice.Volume - 1); } }
internal void Mute() { _defaultPlaybackDevice.SetMuteAsync(true); }
public static void Mute(bool Enable) => _defaultPlaybackDevice.SetMuteAsync(Enable).Wait();