【发布时间】:2019-07-03 17:51:20
【问题描述】:
我正在运行一些简单的主方法代码,用于实例化 SpeechRecognitionEngine 并将一些语法数据传递给它。我似乎无法找到错误不断出现的原因。我尝试删除 .csproj 和 .suo 并没有改变。
SpeechRecognitionEngine spe = new SpeechRecognitionEngine();
Choices commands = new Choices();
commands.Add("hello", "what is your name");
GrammarBuilder gB = new GrammarBuilder(commands);
Grammar g = new Grammar(gB);
//every single call to spe.SomeMethod() breaks with the error in the title
spe.LoadGrammarAsync(g);
spe.SetInputToDefaultAudioDevice();
spe.RecognizeAsync(RecognizeMode.Multiple);
【问题讨论】:
标签: c# visual-studio