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; * * }*/ } }
public MicrophoneHandling(int cooldown) { mMicrophoneMuter = new WindowsMicrophoneMuteLibrary.WindowsMicMute(); mCooldown = cooldown; // TODO: Make this configurable mTimer = new Timer(); mTimer.Interval = mCooldown; mTimer.Elapsed += UnmuteMic; mTimer.AutoReset = false; }
private void btnChamada_Click(object sender, EventArgs e) { // inicia o timer timerLocucao.Start(); //mostra o label lblLocucao.Visible = true; // realiza o controle das musicas ControlaMusica(statusMusic); WindowsMicrophoneMuteLibrary.WindowsMicMute micMute = new WindowsMicrophoneMuteLibrary.WindowsMicMute(); micMute.UnMuteMic(); }
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(); }
public Form1() { SpeechRecognitionEngine rec = new SpeechRecognitionEngine(); list.Add(new String[] { "hello", "how are you", "how are you doing", "what time is it", "what is today", "what day is today", "what is the date", "open google", "wake up", "sleep", "restart", "update", "light on", "light off", "oh really", /*"open bing",*/ "open minecraft", "close minecraft", "close voice bot", "whats the weather like", "whats the temperature", "pink fluffy encrypted unicorns", "thank you", "bot", "please play super secret music", "minimize", "maximize", "tell me a joke", "unminimize", "unmaximize", "play", "pause", "spotify", "next", "last" }); Grammar gr = new Grammar(new GrammarBuilder(list)); WindowsMicrophoneMuteLibrary.WindowsMicMute micMute = new WindowsMicrophoneMuteLibrary.WindowsMicMute(); try { rec.RequestRecognizerUpdate(); rec.LoadGrammar(gr); rec.SpeechRecognized += rec_SpeachRecognized; rec.SetInputToDefaultAudioDevice(); rec.RecognizeAsync(RecognizeMode.Multiple); } catch { return; } s.SelectVoiceByHints(VoiceGender.Female); InitializeComponent(); }
public Form1() { InitializeComponent(); micMute = new WindowsMicrophoneMuteLibrary.WindowsMicMute(); Search(); }
private void timerLocucao_Tick(object sender, EventArgs e) { string vlFinal = "01:00"; WindowsMicrophoneMuteLibrary.WindowsMicMute micMute = new WindowsMicrophoneMuteLibrary.WindowsMicMute(); if (statusLocucao < 60) { statusLocucao = statusLocucao + 1; lblLocucao.Text = "Parar Locução \n" + TimeSpan.FromSeconds(statusLocucao).ToString("mm\\:ss") + " até " + vlFinal; } else { lblLocucao.Visible = false; lblLocucao.Text = ""; //para a locução timerLocucao.Stop(); statusLocucao = 0; micMute.UnMuteMic(); //retorna a música caso esteja tocando RetornaMusica(RetMusic); } }
private void lblLocucao_Click(object sender, EventArgs e) { WindowsMicrophoneMuteLibrary.WindowsMicMute micMute = new WindowsMicrophoneMuteLibrary.WindowsMicMute(); lblLocucao.Visible = false; lblLocucao.Text = ""; //para a locução timerLocucao.Stop(); statusLocucao = 0; micMute.UnMuteMic(); //retorna a música caso esteja tocando RetornaMusica(RetMusic); }