Example #1
0
 public void MusicCommand(RecognizedPhrase e)
 {
     try
     {
         SpeechHandler.SetResponse(Processor.MusicCommand(e.Text));
     }
     catch (Exception)
     {
         SpeechHandler.Invalid();
     }
 }
Example #2
0
 public void Friday()
 {
     try
     {
         SpeechHandler.SetResponse(Processor.Friday());
     }
     catch (Exception)
     {
         SpeechHandler.Invalid();
     }
 }
Example #3
0
 public void PlayList()
 {
     try
     {
         SpeechHandler.SetResponse(Processor.PlayList());
     }
     catch (Exception)
     {
         SpeechHandler.Invalid();
     }
 }
Example #4
0
 public void CheckInternet()
 {
     try
     {
         SpeechHandler.SetResponse(Processor.CheckInternet());
     }
     catch (Exception)
     {
         SpeechHandler.Invalid();
     }
 }
Example #5
0
 public void Screenshot()
 {
     try
     {
         SpeechHandler.SetResponse(Processor.Screenshot());
     }
     catch (Exception)
     {
         SpeechHandler.Invalid();
     }
 }
Example #6
0
 public void Complement()
 {
     try
     {
         SpeechHandler.SetResponse(Processor.Complement());
     }
     catch (Exception)
     {
         SpeechHandler.Invalid();
     }
 }
Example #7
0
 public void ShowTime()
 {
     try
     {
         SpeechHandler.SetResponse(Processor.ShowTime());
     }
     catch (Exception)
     {
         SpeechHandler.Invalid();
     }
 }
Example #8
0
 public void Greeting()
 {
     try
     {
         SpeechHandler.SetResponse(Processor.Greeting());
     }
     catch (Exception)
     {
         SpeechHandler.Invalid();
     }
 }
Example #9
0
 public void Weather()
 {
     try
     {
         string home = "Cairo";
         SpeechHandler.SetResponse(Processor.Weather(home));
     }
     catch (Exception)
     {
         SpeechHandler.Invalid();
     }
 }
Example #10
0
        public void Converter(RecognizedPhrase e)
        {
            string num = e.Words[e.Words.Count - 1].Text;

            try
            {
                SpeechHandler.SetResponse(Processor.Converter(e.Text, num));
            }
            catch (Exception)
            {
                SpeechHandler.Invalid();
            }
        }
Example #11
0
        public void Search(RecognizedPhrase e)
        {
            int    len          = e.Words.Count;
            string searchprompt = e.Text.Substring(e.Text.IndexOf(":") + 1);

            try
            {
                SpeechHandler.SetResponse(Processor.Search(searchprompt));
            }
            catch (Exception)
            {
                SpeechHandler.Invalid();
            }
        }
Example #12
0
        public void Opener(RecognizedPhrase e)
        {
            int    len = e.Words.Count;
            string app = e.Words[len - 1].Text;

            try
            {
                SpeechHandler.SetResponse(Processor.Opener(app) + app);
            }
            catch (Exception)
            {
                SpeechHandler.Invalid();
            }
        }
Example #13
0
        public void RandomNum(RecognizedPhrase e)
        {
            int    len    = e.Words.Count;
            string numOne = e.Words[len - 3].Text;
            string numTwo = e.Words[len - 1].Text;

            try
            {
                SpeechHandler.SetResponse(Processor.RandomNum(numOne, numTwo));
            }
            catch (Exception)
            {
                SpeechHandler.Invalid();
            }
        }
Example #14
0
 void engine_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
 {
     if (e.Result == null)
     {
         return;
     }
     //Console.WriteLine(e.Result.Text + "\n");
     //Console.WriteLine(e.Result.Grammar.Name + "\n");
     gbEX.ExecutionHandler(e);
     Console.Write(SpeechHandler.UtterResponse() + "\n");
     SpeechHandler.speechSynthesizer.SpeakAsync(SpeechHandler.UtterResponse());
     SpeechHandler.SetResponse("");
     if (ByeJarvis == 1)
     {
         ByeJarvis = 2;
     }
 }