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; * * }*/ } }
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"; } } }
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(); }
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(); }
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(); } }