how to add a custom lexicon in my c # project

2019-06-04 03:01发布

I m developing an c# project based on voice recognition. I want to recognize words in Indian English accent so for that i thought for lexicon & then adding pronunciations in that file but I m not getting how to add a lexicon in my project & how to create a lexicon?

1条回答
叼着烟拽天下
2楼-- · 2019-06-04 03:17

Lexicons aren't exposed via System.Speech.Recognition, unfortunately. You can access lexicons using the SpeechLib automation interface to SAPI, though; the object you want to create is SpLexicon.

Note that System.Speech.Recognition will automatically load any user lexicons, so you can have a separate app to build the lexicon and your reco app can continue to use System.Speech.Recognition.

Also, if you're using a command & control grammar, you should specify pronunciations directly; for example, the SrgsToken class allows you to explicitly specify a pronunciation for the word. (Unfortunately, I can't remember how to do this with System.Speech.Recognition.GrammarBuilder, but it is possible.)

查看更多
登录 后发表回答