C#: transcribe WAV file to text (speech-to-text) with System.Speech namespaces

隐身守侯 提交于 2019-12-03 03:15:55

The classes in System.Speech are for text to speech (primarily an acessibility feature).

You are looking for voice recognition. There is the System.Speech.Recognition namespace available since .Net 3.0. It uses the Windows Desktop Speech engine. This might get you started, but I guess there are better engines out there.

Voice recognition is very complicated and hard to do right, there are also some commercial products available.

Michael Levy

I realize this is an old question, but there is better information available in later questions and answers. For example see What is the best option for transcribing speech-to-text in a asp.net web app?

Instead of calling SetInputToDefaultAudioDevice() you can call SetInputToWaveFile() to read from an audio file.

The desktop recognition engine that comes in Windows Vista and Windows 7 includes a dictation grammar as shown in the referenced answer.

You should use the SpeechRecognitionEngine. To use a wave file, call SetInputToWaveFile. I wish I could help you more, but I'm no expert.

Oh, and if your word is really triskaidekaphobia, I don't think even a human speech recognition engine would recognize that...

I have tested your code , but it is not grabbing wave file properly. It is catching

If Not OpenFileDialog1.FileName.Contains("wav") Then MessageBox.Show("Incorrect file") Else TextBox1.Text = OpenFileDialog1.FileName End If

Not the else condition. I tried using .wav in the string also.

I am also in need of a sample code for transcribing wav file to text not from Microphone. Please if u came to a good solution so please post it here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!