I like Bacon

I like Bacon

  • NA
  • 1
  • 2.4k

Google Search, Youtube Search (C#)

Aug 25 2015 10:20 AM
Can someone please help fix this below code. Well I'm trying to make a google search using voice recognition c# 
 
But the code below is ONLY searching for the words inside the Commands.txt that I made. 
 
 _recognizer.LoadGrammar(newGrammar(newGrammarBuilder
(newChoices(System.IO.File.Read@"C:\Commands.txt")))));
 
 
 
if (speech == "I WANT TO SEARCH SOMETHING")
{
QEvent = speech;
ENZO.SpeakAsync("what do you want to search");
speech = string.Empty;
}
else if (speech != string.Empty && QEvent == "I WANT TO SEARCH SOMETHING")
{
Process.Start("http://google.com/search?q=" + speech);
QEvent = string.Empty;
if (ranNum < 6) { ENZO.SpeakAsync("Alright, I am searching " + speech + " in google"); }
else if (ranNum > 5) { ENZO.SpeakAsync("ok sir, I am searching " + speech); }
speech = string.Empty;
}