Add new word to windows speech recognition using C

2019-05-26 00:51发布

问题:

i know how to use speech recognition in C# but the problem is how to add a special word or name into windows speech dictionary database? in windows 7 and 8 you can do it easily using:

Opening Speech Dictionary > Add new word > Enter the Text of word > Record the pronunciation of the word by Microphone

and then,it's OK! the word will add to database. we also can edit the word using the Speech Dictionary. does anyone know how can we do these steps with .NET and programming?

EDIT: its very simple, windows speech dictionary has limited database , how can we add some other words into this via .NET C#? for example name "Salad" doesn't exist in windows speech dictionary. how can i add this word and its pronunciation into windows speech dictionary?

sorry i'm a bit new to this great site.

回答1:

You'll need to use the SAPI Automation APIs (aka SpeechLib) to access the ISpLexicon interfaces.

In particular, ISpLexicon::AddPronunciation will add a new word (and its associated pronunciation) to the user lexicon.