简体   繁体   English

使用非列表的C#语音识别。添加单词

[英]C# Voice Recognition using non list.Add words

I'm trying to search google with whatever I say after "Search google for". 我正在尝试使用“在Google搜索中”之后所说的内容搜索Google。 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. 但是我只能在文本框中显示r ==“”响应。 How do I get anything after "Search google for" to appear there. 在“搜索Google for”之后,如何获取任何内容。

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. 第一个识别引擎在检测到单词“ search google for”时会主动进行搜索,然后调用第二个识别引擎,后者会使用听写语法来检测您所说的内容,然后将结果(e.Result.Text)放入一个文本框。

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 我为您提供了一种可以帮助您达到预期效果的方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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