void sre_SpeechRecognized(object sender, SpeechRecognizedEventArgs e) { //If Selected Functions Keywords were Recognized switch (e.Result.Text.ToString()) { case "hello": { ss.SpeakAsync("hello Sir"); break; } case "how are you": { ss.SpeakAsync("I'm doing Great"); break; } case "what is the time": { ss.SpeakAsync("Current Time is" + DateTime.Now.ToLongTimeString()); break; } case "open chrome": { ss.SpeakAsync("Yes rightaway Sir"); Process.Start("chrome.exe", "http:\\www.google.com"); break; } case "Scroll Up": { ss.SpeakAsync("Yes Sir"); KeyHandle.SendKeyUp(Keys.PageUp); break; } case "scroll down": { ss.SpeakAsync("Yes Sir"); KeyHandle.SendKeyDown(Keys.PageDown); break; } case "open youtube": { ss.SpeakAsync("Yes rightaway Sir"); Process.Start("chrome.exe", "http:\\www.youtube.com"); break; } case "switch light on": { string status = "1"; ss.SpeakAsync("Light is on"); ardo.Open(); ardo.Write(status); ardo.Close(); break; } case "switch light off": { ss.SpeakAsync("Light is off"); ardo.Open(); ardo.Write("0"); ardo.Close(); break; } case "play some music": { /* ss.SpeakAsync("Yes I have just the right thing for you"); * Thread.Sleep(2000); * Process.Start(@"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe", @"D:\Songs\Apologize.mp3"); * break; */ // music = new Microsoft.DirectX.AudioVideoPlayback.Audio(D:\Songs\Apologize.mp3); // music.Play(); // WMPLib.WindowsMediaPlayer mplayer = new WMPLib.WindowsMediaPlayer(); mplayer.URL = @"D:\Songs\Apologize.mp3"; mplayer.controls.play(); break; } case "play some coldplay": { ss.SpeakAsync("Yes Sir"); Process.Start(@"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe", @"D:\Songs\Coldplay-Fix_You.mp3"); break; } case "pause the music": { // WMPLib.WindowsMediaPlayer mplayer = new WMPLib.WindowsMediaPlayer(); // mplayer.URL = @"D:\Songs\Apologize.mp3"; mplayer.controls.pause(); break; } case "continue playing the music": { // WMPLib.WindowsMediaPlayer mplayer = new WMPLib.WindowsMediaPlayer(); // mplayer.URL = @"D:\Songs\Apologize.mp3"; mplayer.controls.play(); break; } case "open vlc": { ss.SpeakAsync("Yes rightaway Sir"); Process.Start(@"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe"); break; } case "thank you": { ss.SpeakAsync("No problem"); break; } case "close": { ss.SpeakAsync("Okay Sir"); Application.Exit(); break; } case "taste my stick": { ss.SpeakAsync("I would glady Sir, but unfortunately I don't have a mouth"); break; } case "What is the weather": { ss.SpeakAsync("It's pretty hot outside."); break; } case "which languages do you speak?": { ss.SpeakAsync("Presently I only understand and speak English."); break; } case "Log Off the computer": { ss.SpeakAsync("Logging off the System"); ExitWindowsEx(0, 0); break; } case "Put the computer to sleep": { ss.SpeakAsync("Putting the computer to sleep"); SetSuspendState(false, true, true); break; } case "shut down the pc": { ss.SpeakAsync("Doing a System Shut Down"); Application.Exit(); Process.Start("shutdown", "/s /t 0"); break; } case "Restart the computer": { ss.SpeakAsync("Doing a System Restart"); Application.Exit(); Process.Start("shutdown", "/r /t 0"); break; } } textBox1.Text = e.Result.Text.ToString() + Environment.NewLine; }
void sre_SpeechRecognized(object sender, SpeechRecognizedEventArgs e) { //If Selected Functions Keywords were Recognized switch (e.Result.Text.ToString()) { case "be quiet": { ss.SpeakAsync("as you wish boss"); label3.Visible = true; label1.Visible = false; label2.Visible = true; label4.Visible = false; // Button Stop Functions sre.RecognizeAsyncStop(); buttonStart.Enabled = true; buttonStop.Enabled = false; break; } case "o mad": { ss.SpeakAsync("you are really funny sir"); break; } case "good girl": { ss.SpeakAsync("ha ha ha funny bone"); break; } case "good night": { ss.SpeakAsync("do have a wonderfull night boss"); break; } case "good day": { ss.SpeakAsync("good day boss"); break; } case "good evening": { ss.SpeakAsync("good evening"); break; } case "good afternoon": { ss.SpeakAsync("good afternoon boss, how is your day going"); break; } case "good morning": { ss.SpeakAsync("good morning boss. Do have a lovely day"); break; } case "mia": { ss.SpeakAsync("yes boss?"); break; } case "f**k you": { ss.SpeakAsync("f**k you too"); break; } case "hi": { ss.SpeakAsync("hello Sir"); break; } case "hello": { ss.SpeakAsync("hello boss"); break; } case "how are you": { ss.SpeakAsync("I'm doing Great"); break; } case "what is the time": { ss.SpeakAsync("Current Time is" + DateTime.Now.ToLongTimeString()); break; } case "open word pad": { ss.SpeakAsync("sure boss"); Process.Start("wordpad.exe"); break; } case "open note pad": { ss.SpeakAsync("sure"); Process.Start("notepad.exe"); break; } case "what are you running on": { ss.SpeakAsync("i'll bring out a list of my system hardware in a second"); Process.Start("dxdiag"); break; } case "mia i want to type": { ss.SpeakAsync("openning wordpad"); Process.Start("wordpad.exe"); break; } case "open netflix": { ss.SpeakAsync("Yes rightaway boss"); Process.Start("chrome.exe", "http:\\www.netflix.com"); break; } case "i want to code": { ss.SpeakAsync("openning notepad"); Process.Start("notepad.exe"); break; } case "mia i am lost": { ss.SpeakAsync("openning google map"); Process.Start("chrome.exe", "http:\\www.google.com/map"); break; } case "open google map": { ss.SpeakAsync("openning google map"); Process.Start("chrome.exe", "http:\\www.google.com/map"); break; } case "i want to see a movie": { ss.SpeakAsync("openning vlc"); Process.Start("vlc.exe"); break; } case "i want to draw": { ss.SpeakAsync("openning paint"); Process.Start("paint.exe"); break; } case "open C M D": { ss.SpeakAsync("Yes rightaway Sir"); Process.Start("cmd.exe"); break; } case "i love you": { ss.SpeakAsync("ha ha ha i love you too"); MessageBox.Show("♥"); break; } case "who made you": { ss.SpeakAsync("Richard Nwonah made me for cyborg"); break; } case "tell me how to use you": { ss.SpeakAsync("i was downloaded with a list of simple commands to help us get along"); break; } case "i want to shop": { ss.SpeakAsync("i have access to amazon, openning"); Process.Start("chrome.exe", "http:\\www.amazon.com"); break; } case "i want to search": { ss.SpeakAsync("Yes rightaway Sir"); Process.Start("chrome.exe", "http:\\www.google.com"); break; } case "Scroll Up": { ss.SpeakAsync("Yes Sir"); KeyHandle.SendKeyUp(Keys.PageUp); break; } case "scroll down": { ss.SpeakAsync("Yes Sir"); KeyHandle.SendKeyDown(Keys.PageDown); break; } case "show email": { ss.SpeakAsync("Yes rightaway Sir"); Process.Start("chrome.exe", "http:\\www.gmail.com"); break; } case "open youtube": { ss.SpeakAsync("Yes rightaway Sir"); Process.Start("chrome.exe", "http:\\www.youtube.com"); break; } case "find my ip": { ss.SpeakAsync("this feature has been removed from this version of the app, but you can open cmd and type ipconfig without space to view your ip"); break; } case "switch light on": { string status = "1"; ss.SpeakAsync("Light is on"); ardo.Open(); ardo.Write(status); ardo.Close(); break; } case "switch light off": { ss.SpeakAsync("Light is off"); ardo.Open(); ardo.Write("0"); ardo.Close(); break; } case "play some music": { /* ss.SpeakAsync("Yes I have just the right thing for you"); * Thread.Sleep(2000); * Process.Start(@"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe", @"D:\Songs\Apologize.mp3"); * break; */ // music = new Microsoft.DirectX.AudioVideoPlayback.Audio(D:\Songs\Apologize.mp3); // music.Play(); // WMPLib.WindowsMediaPlayer mplayer = new WMPLib.WindowsMediaPlayer(); mplayer.URL = @"D:\Songs\Apologize.mp3"; mplayer.controls.play(); break; } case "play some coldplay": { ss.SpeakAsync("Yes Sir"); Process.Start(@"C:\Program Files (x86)\VideoLAN\VLC\vlc.exe", @"D:\Songs\Coldplay-Fix_You.mp3"); break; } case "pause the music": { // WMPLib.WindowsMediaPlayer mplayer = new WMPLib.WindowsMediaPlayer(); // mplayer.URL = @"D:\Songs\Apologize.mp3"; mplayer.controls.pause(); break; } case "continue playing the music": { // WMPLib.WindowsMediaPlayer mplayer = new WMPLib.WindowsMediaPlayer(); // mplayer.URL = @"D:\Songs\Apologize.mp3"; mplayer.controls.play(); break; } case "open vlc": { ss.SpeakAsync("Yes rightaway Sir"); Process.Start("vlc.exe"); break; } case "thank you": { ss.SpeakAsync("No problem"); break; } case "you can go": { ss.SpeakAsync("Okay Sir"); Application.Exit(); break; } case "exit": { ss.SpeakAsync("Okay Sir"); Application.Exit(); break; } case "will you suck my dick": { ss.SpeakAsync("I would glady Sir, but unfortunately I don't have a mouth"); break; } case "What is the weather": { ss.SpeakAsync("It's pretty hot outside."); break; } case "which languages do you speak?": { ss.SpeakAsync("Presently I only understand and speak English."); break; } case "i am going out": { ss.SpeakAsync("Logging off the System"); ExitWindowsEx(0, 0); break; } case "Put the computer to sleep": { ss.SpeakAsync("Putting the computer to sleep"); SetSuspendState(false, true, true); break; } case "shut down the pc": { ss.SpeakAsync("Doing a System Shut Down"); Application.Exit(); Process.Start("shutdown", "/s /t 0"); break; } case "Restart the computer": { ss.SpeakAsync("Doing a System Restart"); Application.Exit(); Process.Start("shutdown", "/r /t 0"); break; } } textBox1.Text = e.Result.Text.ToString() + Environment.NewLine; }