Speech to text using C #

I am trying to create a text editor using the C # language and implement voice recognition for normal file functions, is it possible to implement this. I am very sorry if I repeat the question that was asked earlier. I just want to know if there are ways to convert speech to text using C #. Your help is really valuable. Waiting for an answer. Thanks in advance.

+4
source share
5 answers

Here is a complete example of using C # and System.Speech to convert from speech to text

The code can be divided into two main parts:

setting up the SpeechRecognitionEngine object (and its necessary elements) for processing speech speech and voice hypotheses.

Step 1: Configure SpeechRecognitionEngine

_speechRecognitionEngine = new SpeechRecognitionEngine(); _speechRecognitionEngine.SetInputToDefaultAudioDevice(); _dictationGrammar = new DictationGrammar(); _speechRecognitionEngine.LoadGrammar(_dictationGrammar); _speechRecognitionEngine.RecognizeAsync(RecognizeMode.Multiple); 

At this point, your object is ready to begin transcribing sound from the microphone. However, you need to handle some events in order to access the results.

Step 2: Handling 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 response from the engine string finalAnswer = e.Result.Text; }

Here it is. If you want to use a pre-recorded .wav file instead of a microphone, you should use

_speechRecognitionEngine.SetInputToWaveFile (pathToTargetWavFile);

instead

_speechRecognitionEngine.SetInputToDefaultAudioDevice ();

There are many different options in these classes, and they are worth exploring in more detail.

http://ellismis.com/2012/03/17/converting-or-transcribing-audio-to-text-using-c-and-net-system-speech/

+2
source

If I remember correctly, the Microsoft Speech SDK supports speech in text.

+1
source

Then the LumenVox Speech Engine will appear.

+1
source

There is also an iSpeech API that can be used for speech recognition as a web service.

0
source

All Articles