禁用内置语音识别命令吗? [英] Disable built-in speech recognition commands?
问题描述
我试图建立的软件,除$ P $点不同的文本命令,都在一个自定义的方式。我用System.Speech.Recognition和它的作品出奇地好,但我想不出如何绕过一个事实,即每当我说删除,关闭,正确的,等等,我最终会使用默认视窗(7)实施。有没有什么办法来解决与System.Speech.Recognition?如果不是,这C#.net库中,你会推荐最?
I'm trying to build software that interprets various textual commands, all in a custom way. I use System.Speech.Recognition and it works surprisingly well, but I can't figure how to get around the fact that whenever I say "Delete", "Close", "Correct", etc, I will end up with the default Windows (7) implementation. Is there any way to get around that with System.Speech.Recognition? If not, which C# .NET library would you recommend the most?
推荐答案
使用SpeechRecognitionEngine代替SpeechRecognizer。
试试这个:
Use SpeechRecognitionEngine instead of SpeechRecognizer.
Try this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Speech.Recognition;
namespace speech
{
class Program
{
static void Main(string[] args)
{
SpeechRecognitionEngine mynizer = new SpeechRecognitionEngine();
GrammarBuilder builder = new GrammarBuilder();
builder.AppendDictation();
Grammar mygram = new Grammar(builder);
mynizer.SetInputToDefaultAudioDevice();
mynizer.LoadGrammar(mygram);
while (true)
{
Console.WriteLine(mynizer.Recognize().Text);
}
}
}
}
这篇关于禁用内置语音识别命令吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!