C# Youtube、谷歌、Facebook语音搜索(语音识别C)

C# Youtube、谷歌、Facebook语音搜索(语音识别C),c#,speech-recognition,voice-recognition,speech-to-text,google-voice,C#,Speech Recognition,Voice Recognition,Speech To Text,Google Voice,有人能告诉我怎么修吗?它只搜索我在Commands.txt中写的关键字\u recognizer.LoadGrammar(新语法)(新语法生成器(新选项(System.IO.File.ReadAllLines)(@“C:\Commands.txt”;))当它问我你想搜索什么时?我说的是“香蕉”,但是Commands.txt中没有香蕉,所以它不会做任何事情 嗯。我希望它是这样的。当你说我想搜索一些东西(它会问你想搜索什么),然后你想说任何东西(水果、酒店、人、动物——所有你想说的话)。它应该出现在

有人能告诉我怎么修吗?它只搜索我在Commands.txt中写的关键字<代码>\u recognizer.LoadGrammar(新语法)(新语法生成器(新选项(System.IO.File.ReadAllLines)(@“C:\Commands.txt”;))当它问我你想搜索什么时?我说的是“香蕉”,但是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;
}
if (speech.ToLower().Contains("search for")) // See if the string contains the 'search for' string.
{
     string query = speech.Replace("search for", ""); // Remove the 'search for' text.
     // Old code (does not make the text fully URL safe)
     // query = query.Replace(' ', '+'); 
     query = System.Web.HttpUtility.UrlEncode(query);
     string url = "https://www.google.com.au/search?q=" + query;
     System.Diagnostics.Process.Start(url);
}