コード例 #1
0
        public void say(String h)
        {
            if (pockey == true)
            {
                if (isitonce == false)
                {
                    bfr = DateTime.Now;
                }
                DateTime afr = new DateTime();
                afr = DateTime.Now;
                int safr = afr.Second;
                int sbfr = bfr.Second;
                if (safr - sbfr >= 7)
                {
                    italk = false;
                    Console.WriteLine(safr + "and" + sbfr);
                }
                else if (safr - sbfr <= 6 && safr - sbfr >= 0)
                {
                    isitonce = true;
                    Console.WriteLine(safr + "and" + sbfr);
                }
                else
                {
                    safr    += 60;
                    isitonce = true;
                }
                bfr = DateTime.Now;
                WindowsMicrophoneMuteLibrary.WindowsMicMute micMute = new WindowsMicrophoneMuteLibrary.WindowsMicMute();
                micMute.MuteMic();
                pockey = false;
                s.Speak(h);
                textBox2.AppendText(h + "\n");
                micMute.UnMuteMic();
                // if (isitonce == false)
                //{



                //}
                //secb = bfr.Second;
                pockey = true;

                /*seca = afr.Second;
                 * if (seca - secb >= 10)
                 * {
                 *  italk = false;
                 *
                 * }
                 * else if (seca - secb <= 9)
                 * {
                 *  isitonce = true;
                 * }
                 * else
                 * {
                 *  seca += 60;
                 *
                 * }*/
            }
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: IntelMin/MicrophoneMuter
        private void muteBtn_Click(object sender, EventArgs e)
        {
            if (listView1.SelectedIndices.Count == 0)
            {
                muteBtn.Enabled = false;
                return;
            }

            int  index = listView1.SelectedIndices[0];
            bool bMuted;

            if (listView1.Items[index].SubItems[1].Text.Equals("Muted"))
            {
                bMuted = true;
            }
            else
            {
                bMuted = false;
            }

            if (micMute.MuteMic(index, !bMuted))
            {
                if (bMuted)
                {
                    muteBtn.Text = "Mute";
                    listView1.Items[index].SubItems[1].Text = "Unmuted";
                }
                else
                {
                    muteBtn.Text = "Unmute";
                    listView1.Items[index].SubItems[1].Text = "Muted";
                }
            }
        }
コード例 #3
0
        public void TriggeredLimit()
        {
            mMicrophoneMuter.MuteMic();

            // Reset the timer if we trigger it again while it's still ongoing.
            mTimer.Stop();
            mTimer.Interval = mCooldown;
            mTimer.Start();
        }
コード例 #4
0
ファイル: Program.cs プロジェクト: IntelMin/MicrophoneMuter
 static void Main(string[] args)
 {
     Console.WriteLine("Preparing Windows Microphone Mute Library...");
     WindowsMicrophoneMuteLibrary.WindowsMicMute micMute = new WindowsMicrophoneMuteLibrary.WindowsMicMute();
     Console.WriteLine("We will now mute the microphone, press enter to mute.");
     Console.ReadLine();
     micMute.MuteMic();
     Console.WriteLine("Microphone should now be muted, press enter to unmute.");
     Console.ReadLine();
     micMute.UnMuteMic();
     Console.WriteLine("Microphone should now be unmuted, press enter to quit.");
     Console.ReadLine();
 }
コード例 #5
0
 private void Form1_KeyDown(object sender, KeyEventArgs e)
 {
     if (setKey == true)
     {
         keyBind            = e.KeyCode.ToString();
         keyBind_Label.Text = "Current Key: " + keyBind;
         setKey             = false;
     }
     if (e.KeyCode.ToString() == keyBind)
     {
         micMute.MuteMic();
     }
 }