将音频转换为文本
我只是想知道 Java 或 C# 中是否有任何内置库或外部库允许我获取音频文件并解析它并从中提取文本。
我需要提出申请才能这样做,但我不知道从哪里开始。
I just want to know if there is any build in libraries or external libraries in Java or C# that allow me to take an audio file and parse it and extract the text from it.
I need to make an application to do so, but I don't know from where I can start.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
以下是一些选项:
Here are some of your options:
这是使用 C# 和 System.Speech 的完整示例
代码可分为 2 个主要部分:
配置 SpeechRecognitionEngine 对象(及其所需元素)
处理 SpeechRecognized 和 SpeechHypothesized 事件。
第 1 步:配置 SpeechRecognitionEngine
此时,您的对象已准备好开始从麦克风转录音频。不过,您需要处理一些事件,才能真正访问结果。
第 2 步:处理 SpeechRecognitionEngine 事件
就是这样。如果您想使用预先录制的 .wav 文件而不是麦克风,您可以使用
而不是
这些课程中有很多不同的选项,值得更详细地探索。
http://ellismis.com/2012/03/17/converting-or-transcribing-audio-to-text-using-c-and-net-system-speech/
Here is a complete example using C# and System.Speech
The code can be divided into 2 main parts:
configuring the SpeechRecognitionEngine object (and its required elements)
handling the SpeechRecognized and SpeechHypothesized events.
Step 1: Configuring the SpeechRecognitionEngine
At this point your object is ready to start transcribing audio from the microphone. You need to handle some events though, in order to actually get access to the results.
Step 2: Handling the SpeechRecognitionEngine Events
That’s it. If you want to use a pre-recorded .wav file instead of a microphone, you would use
instead of
There are a bunch of 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/
您可以检查Microsoft Speech API。我认为他们提供了一个 SDK,您可以使用它来实现您的目标。
You might check Microsoft Speech API. I think they provide a SDK that you can use for your objective.
对于Java,Sun似乎有一个解决方案: javax.speech.recognition
For Java, it seems there is a solution from Sun: javax.speech.recognition
您可以使用SoX(声音处理程序的瑞士军刀)将音频文件转换为文本文件,其中数值对应于声音频率/音量。
我已经为之前的项目完成了此操作,但不知道确切的命令选项。
以下是该项目的链接:http://sox.sourceforge.net/Main/HomePage
You can use SoX (the Swiss Army knife of sound processing programs) to convert audio file to text file with numeric values corresponding to sound frequency/volume.
I have done it for a previous project but don't know the exact command options.
Here is a link to the project: http://sox.sourceforge.net/Main/HomePage