Microsoft Speech Recognition Custom Training

核能气质少年 提交于 2019-12-04 09:34:54

Okay, pulling this from a thing I wrote three or four years ago now, but I believe you want to do something like this.

The grammar library is a trained system which can recognize words. You can create your own grammar library cued to specific words.

C#, sorry

using System.Speech
using System.Speech.Recognition
using System.Speech.AudioFormat

SpeechRecognitionEngine sre = new SpeechRecognitionEngine();

string[] words = {"L H C", "CERN"};
Choices choices = new Choices(words);
GrammarBuilder gb = new GrammarBuilder(choices);
Grammar grammar = new Grammar(gb);
sre.LoadGrammar(grammar);

That is as far as I can get you. From docs it looks like you can define the pronunciations somehow. So perhaps that way you could have LHC map directly to a single word. Here are the docs on the grammar class - http://msdn.microsoft.com/en-us/library/system.speech.recognition.grammar.aspx

Small update - see example in their docs here http://msdn.microsoft.com/en-us/library/ms554228.aspx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!