简体   繁体   中英

C# Voice Recognition using non list.Add words

I'm trying to search google with whatever I say after "Search google for". Obviously I can't add everything I'll ever think of in the list of resources at the top. Can someone point me in the right direction?

Here's what I have

    if(r == "search google for")
    {
       System.Diagnostics.Process.Start("https://www.google.com/#q=" + (textBox1.Text));
    }

But I can only get r == "" responses to appear in the text box. How do I get anything after "Search google for" to appear there.

One approach is to use two speech recognition engines. The first recognition engine actively searches for the word "search google for" & when it is detected, then invokes the second recognition engine which uses a dictation grammar that detects what ever you speak & out puts the result (e.Result.Text) to a textbox.

Now you can start you process

System.Diagnostics.Process.Start("https://www.google.com/#q=" + (textBox1.Text));

I have provided you an approach which can help you achieve the desired result

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM