First, don't use SAPI directly, add the reference to "
System.Speech.dll
". This assembly comes with .NET and is in GAC, so you can add the reference from the tab ".NET" of the "Add Reference" window. The namespace is
System.Speech.Recognition
:
http://msdn.microsoft.com/en-us/library/system.speech.recognition.aspx[
^].
You need to use either
SpeechRecognizer
or SpeechRecognitionEngine depending on the features you want, but, most likely, both will work for you. Be careful: one requires STA, another &mdsh; MTA thread apartment state, so you might use on in a separate thread, but this is rarely needed; for example, both console and
System.Windows.Forms
UI can work in either thread apartment model, but WPF requires STA.
Now, what you want is much simpler than five "thousand four hundred sixty seven": you will only need to add 10 digits to grammar, plus probably some words. It's likely that you will need a voice command to enter the whole set of data, or something like that. Please see:
http://msdn.microsoft.com/en-us/library/system.speech.recognition.grammar.aspx[
^],
http://msdn.microsoft.com/en-us/library/system.speech.recognition.grammarbuilder.aspx[
^].
—SA