I am trying to design a text editor using C# language and implement voice recognition for the normal file features , is this possible to implement. I am very sorry if I am repeating the question which has been asked previously. I just want to know if there are ways in converting the Speech to Text using C#. Your help is really valuable . Awaiting for response. Thanks in advance.
-
1welcome to stack overflow. as of now its not that accurate. please read [Whatever Happened to Voice Recognition?](http://www.codinghorror.com/blog/2010/06/whatever-happened-to-voice-recognition.html) – naveen Jul 04 '11 at 09:45
5 Answers
Here is a complete example using C# and System.Speech for converting from speech to text
The code can be divided into 2 main parts:
configuring the SpeechRecognitionEngine object (and its required elements) handling the SpeechRecognized and SpeechHypothesized events.
Step 1: Configuring the SpeechRecognitionEngine
_speechRecognitionEngine = new SpeechRecognitionEngine();
_speechRecognitionEngine.SetInputToDefaultAudioDevice();
_dictationGrammar = new DictationGrammar();
_speechRecognitionEngine.LoadGrammar(_dictationGrammar);
_speechRecognitionEngine.RecognizeAsync(RecognizeMode.Multiple);
At this point your object is ready to start transcribing audio from the microphone. You need to handle some events though, in order to actually get access to the results.
Step 2: Handling the SpeechRecognitionEngine Events
_speechRecognitionEngine.SpeechRecognized -= new EventHandler(SpeechRecognized); _speechRecognitionEngine.SpeechHypothesized -= new EventHandler(SpeechHypothesizing);
_speechRecognitionEngine.SpeechRecognized += new EventHandler(SpeechRecognized); _speechRecognitionEngine.SpeechHypothesized += new EventHandler(SpeechHypothesizing);
private void SpeechHypothesizing(object sender, SpeechHypothesizedEventArgs e) { ///real-time results from the engine string realTimeResults = e.Result.Text; }
private void SpeechRecognized(object sender, SpeechRecognizedEventArgs e) { ///final answer from the engine string finalAnswer = e.Result.Text; }
That’s it. If you want to use a pre-recorded .wav file instead of a microphone, you would use
_speechRecognitionEngine.SetInputToWaveFile(pathToTargetWavFile);
instead of
_speechRecognitionEngine.SetInputToDefaultAudioDevice();
There are a bunch of different options in these classes and they are worth exploring in more detail.

- 7,769
- 4
- 49
- 78
You can use try SharpSphinx A C# version of Sphinx-4 http://sourceforge.net/p/cmusphinx/discussion/sphinx4-sightings/thread/5953c635/?limit=50

- 5,801
- 18
- 57
- 95
There's also the iSpeech API, which could be used for speech recognition as a web service.

- 5,720
- 7
- 49
- 82