Ejemplo n.º 1
0
 public static void SetMute(this LibMWCapture.MWCAP_AUDIO_VOLUME audioStatus, IntPtr videoChannel, bool mute)
 {
     for (int i = 0; i < audioStatus.abMute.Length; i++)
     {
         audioStatus.abMute[i] = mute;
     }
     PInvokeTools.WriteStruct(audioStatus, ptr =>
                              LibMWCapture.MWSetAudioVolume(videoChannel, LibMWCapture.MWCAP_AUDIO_NODE.MWCAP_AUDIO_EMBEDDED_CAPTURE, ptr));
 }
Ejemplo n.º 2
0
        public static void SetAudioVolume(this LibMWCapture.MWCAP_AUDIO_VOLUME audioStatus, IntPtr videoChannel, int percent)
        {
            var volumeIndex = (int)(AudioVolumes.Length / 100.0 * percent);

            volumeIndex = Math.Min(Math.Max(volumeIndex, 0), AudioVolumes.Length - 1);
            var volume = AudioVolumes[volumeIndex];

            for (int i = 0; i < audioStatus.asVolume.Length; i++)
            {
                audioStatus.asVolume[i] = volume;
            }
            PInvokeTools.WriteStruct(audioStatus, ptr =>
                                     LibMWCapture.MWSetAudioVolume(videoChannel, LibMWCapture.MWCAP_AUDIO_NODE.MWCAP_AUDIO_EMBEDDED_CAPTURE, ptr));
        }