Exemple #1
0
        public MicController()
        {
            this.controller = new CoreAudioController();

              this.muteLock = new Object();
              this.timer = new Timer(MUTE_DELAY);
              this.timer.AutoReset = false;
              this.timer.Elapsed += this.Timer_Elapsed;

              this.keyboardHook = new KeyboardHook();
              this.keyboardHook.KeyDown += KeyboardHook_KeyDown;
              this.keyboardHook.KeyUp += KeyboardHook_KeyUp;

              this.mouseHook = new MouseHook();
              this.mouseHook.ButtonDown += MouseHook_ButtonDown;
              this.mouseHook.ButtonUp += MouseHook_ButtonUp;

              this.Mute(true);
        }
Exemple #2
0
        public MicController()
        {
            controller = new CoreAudioController();

            muteLock        = new Object();
            timer           = new Timer(MUTE_DELAY);
            timer.AutoReset = false;
            timer.Elapsed  += Timer_Elapsed;

            keyboardHook          = new KeyboardHook();
            keyboardHook.KeyDown += KeyboardHook_KeyDown;
            keyboardHook.KeyUp   += KeyboardHook_KeyUp;

            mouseHook             = new MouseHook();
            mouseHook.ButtonDown += MouseHook_ButtonDown;
            mouseHook.ButtonUp   += MouseHook_ButtonUp;

            SetAudioDevice(TargetMicrophoneState.Default, controller.DefaultCaptureDevice.Id);

            controller.AudioDeviceChanged.Subscribe(OnAudioDeviceChanged);

            Mute(true);
        }
Exemple #3
0
 public void Dispose()
 {
     KeyboardHook.UnhookWindowsHookEx(hookId);
 }