You can reference the assembly "System.Speech", name space
System.Speech.Recognition
, please see:
http://msdn.microsoft.com/en-us/library/system.speech.recognition.aspx[
^],
http://msdn.microsoft.com/en-us/library/hh361625.aspx[
^].
To make it working you will need to download and install required speech recognition engine. Please see
http://msdn.microsoft.com/en-us/library/hh361636.aspx[
^].
As to the code sample… I do have some, but posting such a sample here could be a bit out of the format of CodeProject
Quick Questions & Answers. Now when you know what to look for, you can find enough samples by yourself:
http://bit.ly/AkFfnk[
^].
Just for example:
http://www.mperfect.net/speechSamples/[
^].
Now, speech recognition is not speech-to-text yet. Speech recognition is normally based on a relatively small custom grammar. It works pretty well. What to do to recognize any arbitrary speech into text? It would need a whole dictionary covering the whole natural language. Such thing does exist. You need to use the class
DictationGrammar
. Please see
http://msdn.microsoft.com/en-us/library/system.speech.recognition.dictationgrammar.aspx[
^].
Try the code sample at the end of the article referenced above, but…
please don't blame me if the results of dictation frustrate you. This is the level of this technology offered by Microsoft these days.
I have read that there are commercial products which provide much better dictation quality, but I never tried.
For more information, please explore this topic starting from
http://en.wikipedia.org/wiki/Speech_recognition[
^].
—SA