示例#1
0
        // 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;
        }
示例#2
0
        // 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;
        }
示例#3
0
        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;
        }
示例#4
0
 public static void SetPlaybackVolume(float volumeAsPercentage)
 {
     var(DevEnum, DeviceCollection) = GetAudioDevice.GetDeviceCollection();
     DevEnum.GetDefaultAudioEndpoint(EDataFlow.eRender, ERole.eMultimedia).AudioEndpointVolume.MasterVolumeLevelScalar = volumeAsPercentage / 100.0f;
 }
示例#5
0
 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;
 }