string speechKey = "<Your_Key>";
string speechRegion = "Your_Region";
var speechConfig = SpeechConfig.FromSubscription(speechKey, speechRegion);
speechConfig.SpeechRecognitionLanguage = "en-US";
using var audioConfig = AudioConfig.FromWavFileInput("<Path to File>");
using var speechRecognizer = new SpeechRecognizer(speechConfig, audioConfig);
var speechRecognitionResult = await speechRecognizer.RecognizeOnceAsync();
Console.WriteLine(speechRecognitionResult.Text);
输出:
但是很明显,转换模型中有一个错误,如果在I'm going to count to three.和One, two, three, here I come之间有停顿,模型将从音频文件中省略One, two, three, here I come句子。
2条答案
按热度按时间krcsximq1#
.wav
音频文件转换为文本,而不会丢失数据。输出:
I'm going to count to three.
和One, two, three, here I come
之间有停顿,模型将从音频文件中省略One, two, three, here I come
句子。gk7wooem2#
我发现错误我的结果不识别数字。这是在我自己的代码。在我的后处理我试图摆脱标点符号的结果。在这里我也不小心摆脱了数字。