【问题标题】:Search Google through speech recognition通过语音识别搜索 Google
【发布时间】:2019-06-09 16:35:12
【问题描述】:

以下代码返回一个空的搜索查询,我需要使用“搜索”作为激活关键字,然后搜索以下单词“搜索”。

private static void rec_speachRecogmized(object sender, 
    SpeechRecognizedEventArgs e)
        {
     if (r.StartsWith("search"))
         { 


     var spec = r.Replace("search", " "); 
        spec.Trim(); spec.Replace(" ", "+"); 
        speech.Speak("searching" + spec); 
        Process.Start("https://www.google.com/search? source=hp&q=" + 
        spec);
        }
         }

【问题讨论】:

标签: c# artificial-intelligence speech-recognition web-search


【解决方案1】:

你需要改变这一行:

Process.Start("https://www.google.com/search? source=hp&q=" + spec);

在:

Process.Start("https://www.google.com/search?q=" + spec);

【讨论】:

  • 我认为问题在于说搜索后得到演讲
  • 您使用什么语音识别器?我用微软的 API 测试过
  • 使用 System.Speech.Synthesis;使用 System.Speech.Recognition;
  • rec.RequestRecognizerUpdate(); rec.LoadGrammar(gr); rec.SpeechRecognized += rec_speachRecognized; rec.SetInputToDefaultAudioDevice(); rec.RecognizeAsync(RecognizeMode.Multiple);
猜你喜欢
  • 2013-09-14
  • 1970-01-01
  • 2010-09-09
  • 1970-01-01
  • 2016-04-03
  • 1970-01-01
  • 2013-09-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多