如何将语音转换为文本? [英] How do I convert my speech to text?
本文介绍了如何将语音转换为文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好。有没有办法将我的演讲转换成文字?我已经知道如何进行文本到语音,但如果我能说话并且计算机自动将我的语音转换为屏幕上的文本,那将会很棒。目前我只想让它在Visual Studio的消息框中将我的演讲变为文本。
Hello. Is there a way to convert my speech to text? I already know how to do text to speech but it would be great if I could just speak and the computer automatically turned my speech into text on the screen. For the moment I just want it to turn my speech into text in a Message Box in Visual Studio.
推荐答案
C#Speech to Text [ ^ ]
Google [ ^ ]
里面有很多好文章:
1)语音识别,语音到文本,文本到语音,以及C#中的语音合成 [ ^ ]
2)< a href =http://www.codeproject.com/Articles/380027/Csharp-Speech-to-Text> C#Speech to Text [ ^ ]
3)< a href =http://www.codeproject.com/Articles/877208/How-to-implement-voice-recognition-in-Csharp-using>如何使用语音到文本在C#中实现语音识别 [ ^ ]
我希望这篇文章可以帮到你:)
There is very good articles available in it:
1)Speech recognition, speech to text, text to speech, and speech synthesis in C#[^]
2)C# Speech to Text[^]
3)How to implement voice recognition in C# using speech-to-text[^]
I hope this articles will help you :)
试试这个One转换音频文件到文本: -
Try this One Convert audio file to text:-
Using System.Speech
public class MyRecognizer {
public string ReadAudio() {
SpeechRecognitionEngine sre = new SpeechRecognitionEngine();
Grammar gr = new DictationGrammar();
sre.LoadGrammar(gr);
sre.SetInputToWaveFile("C:User\\Audio.wav");
sre.BabbleTimeout = new TimeSpan(Int32.MaxValue);
sre.InitialSilenceTimeout = new TimeSpan(Int32.MaxValue);
sre.EndSilenceTimeout = new TimeSpan(100000000);
sre.EndSilenceTimeoutAmbiguous = new TimeSpan(100000000);
StringBuilder sb = new StringBuilder();
while (true)
{
try
{
var recText = sre.Recognize();
if (recText == null)
{
break;
}
sb.Append(recText.Text);
}
catch (Exception ex)
{
//handle exception
//...
break;
}
}
return sb.ToString();
}
}
这篇关于如何将语音转换为文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文