Speech语音识别的一个问题,谢谢

xiaokan1982 2008-10-22 04:02:03
using System.Speech.Synthesis;
using System.Speech.Recognition;

public static void Ear()
{
SpeechRecognitionEngine SRE = new SpeechRecognitionEngine();
SRE.SetInputToDefaultAudioDevice();
GrammarBuilder GB = new GrammarBuilder();
GB.Append(new Choices("cut", "good"));
Grammar G = new Grammar(GB);
SRE.UnloadAllGrammars();
SRE.LoadGrammar(G);
SRE.SpeechRecognized +=new EventHandler<SpeechRecognizedEventArgs>(SRE_SpeechRecognized);
SRE.SpeechHypothesized += new EventHandler<SpeechHypothesizedEventArgs>(SRE_SpeechHypothesized);
}

程序编译能过,但是运行到SRE.SetInputToDefaultAudioDevice();这句就报一个错误Value does not fall within the expected range.

请各位帮下忙,谢谢大家了,我刚接触这个还很不熟悉呢。谢谢
...全文
154 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
xiaokan1982 2008-10-29
  • 打赏
  • 举报
回复


大家帮忙,谢谢
xiaokan1982 2008-10-24
  • 打赏
  • 举报
回复
UP 大家帮忙,谢谢了
xiaokan1982 2008-10-23
  • 打赏
  • 举报
回复
UP
哥本哈士奇 2008-10-22
  • 打赏
  • 举报
回复
用微软自带的?好像评价不是很好噢。
xiaokan1982 2008-10-22
  • 打赏
  • 举报
回复
UP thanks

110,534

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧