如何在vb.net 2010中将音频文件转换为word文件? [英] How to covert Audio file to word file in vb.net 2010?

查看:134
本文介绍了如何在vb.net 2010中将音频文件转换为word文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在vb.net 2010(Windows应用程序)中将音频文件转换为word文件。请一步一步帮助我。

推荐答案

正如以上Pheonyx兄弟所建议的......

这里是你的VB.NET转换函数代码。

将返回的字符串重定向到TextBox或TextFile。

然后将其复制到你的word文件



As suggested by Pheonyx bro above...
Here's your VB.NET code for conversion function.
Redirect the returned string to a TextBox or to a TextFile.
then copy it to your word file

Dim sre As New SpeechRecognitionEngine()
Dim gr As Grammar = New DictationGrammar()
sre.LoadGrammar(gr)
sre.SetInputToWaveFile("YourWavFileLocation") 'you must give full path 
sre.BabbleTimeout = New TimeSpan(Int32.MaxValue)
sre.InitialSilenceTimeout = New TimeSpan(Int32.MaxValue)
sre.EndSilenceTimeout = New TimeSpan(100000000)
sre.EndSilenceTimeoutAmbiguous = New TimeSpan(100000000)

Dim sb As New StringBuilder()
While True
    Try
        Dim recText = sre.Recognize()
        If recText Is Nothing Then
            Exit Try
        End If

        sb.Append(recText.Text)
    Catch ex As Exception
        'handle exception
        'give msgbox about error or etc
    End Try
End While
Return sb.ToString()


你显然没有对这个问题进行过研究,所以这里有一个可能的起点。



http://stackoverflow.com/questions/17895933/using -system - 语音 - 转换 - 的MP3文件到-text [ ^ ]



我建议您查看一下(代码在c#中,但很容易转换为vb.net) 。



一旦你将它转换为文本,你就可以把它放在word文件中。
You've clearly done no research on the subject, so here is a possible starting point.

http://stackoverflow.com/questions/17895933/using-system-speech-to-convert-mp3-file-to-text[^]

I suggest you have a look at that (the code is in c# but can easily be converted to vb.net).

Once you have it converting to text then you can put it in a word file.


这篇关于如何在vb.net 2010中将音频文件转换为word文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆