// If the RecordingVolume parameter received a value public static void SetRecordingVolume(int volumeAsPercentage) { var(DevEnum, DeviceCollection) = GetAudioDevice.GetDeviceCollection(); // Set the volume level of the default recording device to that of the float value received by the RecordingVolume parameter DevEnum.GetDefaultAudioEndpoint(EDataFlow.eCapture, ERole.eMultimedia).AudioEndpointVolume.MasterVolumeLevelScalar = volumeAsPercentage / 100.0f; }
// If the RecordingMuteToggle paramter was called public static void RecordingMuteToggle() { var(DevEnum, DeviceCollection) = GetAudioDevice.GetDeviceCollection(); // Toggle the mute state of the default recording device DevEnum.GetDefaultAudioEndpoint(EDataFlow.eCapture, ERole.eMultimedia).AudioEndpointVolume.Mute = !DevEnum.GetDefaultAudioEndpoint(EDataFlow.eCapture, ERole.eMultimedia).AudioEndpointVolume.Mute; }
public static void SetRecordingMute(bool muteState) { var(DevEnum, DeviceCollection) = GetAudioDevice.GetDeviceCollection(); // Set the mute state of the default recording device to that of the boolean value received by the Cmdlet DevEnum.GetDefaultAudioEndpoint(EDataFlow.eCapture, ERole.eMultimedia).AudioEndpointVolume.Mute = muteState; }
public static void SetPlaybackVolume(float volumeAsPercentage) { var(DevEnum, DeviceCollection) = GetAudioDevice.GetDeviceCollection(); DevEnum.GetDefaultAudioEndpoint(EDataFlow.eRender, ERole.eMultimedia).AudioEndpointVolume.MasterVolumeLevelScalar = volumeAsPercentage / 100.0f; }
public static void PlaybackMuteToggle() { var(DevEnum, DeviceCollection) = GetAudioDevice.GetDeviceCollection(); DevEnum.GetDefaultAudioEndpoint(EDataFlow.eRender, ERole.eMultimedia).AudioEndpointVolume.Mute = !DevEnum.GetDefaultAudioEndpoint(EDataFlow.eRender, ERole.eMultimedia).AudioEndpointVolume.Mute; }