Windows 7中的语音识别 [英] Speech Recognition in Windows 7

查看:173
本文介绍了Windows 7中的语音识别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何将口语与音频文件进行比较?考虑一个案例,我用麦克风说这是一个例子"并将其保存为.mp3文件.然后我将其保存在数据库中.我的应用程序将运行,如果我说这是一个例子",它可以通过与数据库中的音频文件进行比较来检测到该情况,如果比较成功就可以写出这些单词.

How can a spoken word can be compared with an audio file?Consider a case,I say "This is an example" by microphone and save it as a .mp3 file.Then i will save it in a database.Then when my application will run,if i say "This is an example" it can detect that by comparing with that audio file from database and write those words if compare is succeed.

推荐答案

是的,
.Net为此提供了dll,
有关参考代码,请参见 http://msdn.microsoft.com/en-us /library/system.speech.recognition.speechrecognizer.aspx [ ^ ]
祝您编码愉快!
:)
yes you can,
.Net Provides dll for this,
for reference code see,http://msdn.microsoft.com/en-us/library/system.speech.recognition.speechrecognizer.aspx[^]
Happy Coding!
:)


首先,包含System.Speech库.
下一个是我的控制台应用程序代码:

First, include the System.Speech library.
My code, for a console application, is the next:

// default using statements
// then import System.Speech.Recognition namespace
using System.Speech.Recognition

namespace SpeechRecognition
{
     static class Program
     {
         static void Main(string[] args)
         {
               SpeechRecognizer sr = new SpeechRecognizer();
            sr.LoadGrammar(new Grammar(new GrammarBuilder("First test")));
            sr.LoadGrammar(new Grammar(new GrammarBuilder("Second test")));
            sr.SpeechRecognized += new EventHandler<speechrecognizedeventargs>
                 (sr_SpeechRecognized);
         }
         static void sr_SpeechRecognized(object sender,
                   SpeechRecognizedEventArgs e)
         {
              Console.WriteLine(e.Result.Text);
         }
     }
}


当您说首次测试"时,您会在控制台上找到首次测试".
当您说第二项测试"时,您会在控制台上找到第二项测试".


When you say "First test", you''ll find "First test" on the console.
When you say "Second test", you''ll find "Second test" on the console.


最重要的信息只是作为对答案的注释:不同的语言-孟加拉语".
为什么这是最重要的信息?
语音识别始于从音频流中检索音素".可用的音素-以及它们的确切发音-随语言而异.
接下来,它尝试从音素构建单词.单词必须出现在字典中.当然,不同的语言会有不同的词.
接下来,将单词组合成短语.为此,需要大量有关组合单词出现的统计信息.这不仅取决于语言,还取决于特定的上下文(法律,医学等).
因此,仅支持那些语言(例如语音识别).
The most important information was provided as a comment to an answer only: "different language - Bengali".
Why is this the most important info?
Speech recognition starts with retrieving "phonems" from the audio stream. The phonems available - and their exact pronounciation - differs between languages.
Next, it tries to build words from the phonems. The words have to be present in a dictionary. Of course, different languages have different words.
Next, words are combined into phrases. A lot of statistical information on combined word occurencies is required for that. That depends not only on the language, but also on the specific context (legal, medical, ...).
Consequently, only those languages can be supported the speech recognition egine was built for.


这篇关于Windows 7中的语音识别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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