Esempio n. 1
0
 protected static void textInput()
 {
     while (true)
     {
         string s = Console.ReadLine();
         //Console.WriteLine(s);
         //speechText.speech(s);
         CommandClass.process(s);
         Thread.Sleep(0);
     }
 }
Esempio n. 2
0
        static void sre_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)//событие распознавания речи
        {
            if (e.Result.Confidence > 0.6)
            {
                //l.Text = e.Result.Text; //вывести на экран - то, что я сказал
                //speechText.speech(e.Result.Text);// и произнести это
                CommandClass.process(e.Result.Text);
                speechText.speech(e.Result.Text);

                /*
                 * if (e.Result.Text == "доброе утро компьютер")
                 * {
                 *  //brw.Show();
                 *  //speechText.speech("Доброе утро!");
                 *  CommandClass.process("Доброе утро!");
                 * }
                 * else if (e.Result.Text == "спасибо компьютер")
                 * {
                 *  //brw.Hide();
                 *
                 * }
                 * else if (e.Result.Text == "компьютер включи музыку")
                 * {
                 *
                 * }
                 * else if (e.Result.Text.Contains("что такое"))
                 * {
                 *  string str = e.Result.Text.Replace("что такое ", string.Empty);
                 *  //speech(search(str));
                 * }
                 * else if (e.Result.Text == "спасибо хватит")
                 * {
                 *  /*
                 *  //speechText.speech("Хорошо.");
                 *  CommandClass.process("Хорошо.");
                 *
                 * }
                 * else if (e.Result.Text.Contains("компьютер включи"))
                 * {
                 *  string str = e.Result.Text.Replace("компьютер включи ", string.Empty);
                 *  if (str == "гугл хром")
                 *  {
                 *      System.Diagnostics.Process Proc = new System.Diagnostics.Process();
                 *      Proc.StartInfo.FileName = "chrome.exe";
                 *      Proc.Start();
                 *  }
                 * }*/
                /*else if (e.Result.Text.Contains("напиши"))
                 * {
                 *  string str = e.Result.Text.Replace("напиши ", string.Empty);
                 *  if (str == "контакт")
                 *  {
                 *      SendKeys.Send("v");
                 *      SendKeys.Send("k");
                 *      SendKeys.Send("{ENTER}");
                 *  }
                 * }*/

                /*if (brw.Visible)
                 * {
                 *  if (e.Result.Text == "ниже")
                 *  {
                 *      br2_x += 300;
                 *      brw.br2_scrol(true, br2_x);
                 *  }
                 *  else if (e.Result.Text == "выше")
                 *  {
                 *      br2_x -= 300;
                 *      brw.br2_scrol(false, br2_x);
                 *  }
                 * }*/
            }
        }