I need to add thousands of new words to speech dictionary on windows 7 by visual studio from an input file to use in windows' native speech recognition. is it possible? Should I use Microsoft Speech API (SAPI) 5.4 ? If so help me with that. thanks.

有帮助吗?

解决方案

You can't do that with the System.Speech.Recognition library; you have to use the speechlib automation interface.

Once you've got a reference to speechlib in your project, you can add pronunciations using the AddPronunciation method like this:

static void AddPronunciations()
{
    SpLexicon lex = new SpeechLib.SpLexicon();
    long langid = Thread.CurrentCulture.LCID;
    lex.AddPronunciation("word", langid);
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top