社区
.NET Framework
帖子详情
C#如何开发语音识别,最好有例子
尹成学院
2009-06-25 09:41:23
C#如何开发语音识别,最好有例子
...全文
389
5
打赏
收藏
C#如何开发语音识别,最好有例子
C#如何开发语音识别,最好有例子
复制链接
扫一扫
分享
转发到动态
举报
写回复
配置赞助广告
用AI写文章
5 条
回复
切换为时间正序
请发表友善的回复…
发表回复
打赏红包
evaa006
2009-06-25
打赏
举报
回复
[Quote=引用 3 楼 yfqvip 的回复:]
楼主又在倒粪了.建议你换个不明显的id,并且换个问题.你倒粪有什么意思?是想被封ID?
[/Quote]
强ding
evaa006
2009-06-25
打赏
举报
回复
晕,倒粪贴。。。。
满衣兄
2009-06-25
打赏
举报
回复
楼主又在倒粪了.建议你换个不明显的id,并且换个问题.你倒粪有什么意思?是想被封ID?
evaa006
2009-06-25
打赏
举报
回复
UP
尹成
2009-06-25
打赏
举报
回复
废话少说看代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using SpeechLib;
using System.Windows.Forms;
using System.Collections;
namespace yincheng01@163.com
{
public class speechxp
{
private SpeechLib.SpSharedRecoContext objRecoContext;
private SpeechLib.ISpeechRecoGrammar grammar;
private SpeechLib.ISpeechGrammarRule rule = null;
private SpeechLib.ISpeechGrammarRuleState state;
private SpeechLib.ISpeechPhraseElement PhraseElem;
public System.Windows.Forms.Control cDisplay;
public speechxp(string FileName, Control cDisplay)
{
}
private void initSAPI()
{
try
{
objRecoContext = new SpeechLib.SpSharedRecoContext();
objRecoContext.AudioLevel += new _ISpeechRecoContextEvents_AudioLevelEventHandler(RecoContext_VUMeter);//设置声音事件的响应函数
objRecoContext.Recognition += new _ISpeechRecoContextEvents_RecognitionEventHandler(RecoContext_Recognition);//设置成功识别事件的响应函数
objRecoContext.EventInterests = SpeechLib.SpeechRecoEvents.SRERecognition | SpeechLib.SpeechRecoEvents.SREAudioLevel;//设置响应事件
//create grammar interface with ID = 0
grammar = objRecoContext.CreateGrammar(1);//语法的实例
}
catch (Exception ex)
{
MessageBox.Show("Exception \n" + ex.ToString(), "Error - initSAPI");
}
}
private void SAPIGrammarFromFile(string FileName)
{
try
{
grammar.CmdLoadFromFile(FileName, SpeechLib.SpeechLoadOption.SLODynamic);
grammar.CmdSetRuleIdState(0, SpeechRuleState.SGDSActive);
}
catch
{
MessageBox.Show("Error loading file " + FileName + "\n", "Error - SAPIGrammarFromFile");
}
}
public void RecoContext_Recognition(int StreamNumber, object StreamPosition, SpeechRecognitionType RecognitionType, ISpeechRecoResult e)
{
//calculate accuracy
int i;
ArrayList reco = new ArrayList();
string phrase = e.PhraseInfo.GetText(0, -1, true);
cDisplay.Text = e.PhraseInfo.GetText(0, -1, true);
foreach (SpeechLib.ISpeechPhraseElement PhraseElem in e.PhraseInfo.Elements)
{
/// listBox1.Items.Add(PhraseElem.Pronunciation);
}
i = e.PhraseInfo.Elements.Count;
for (int h = 0; h < i; h++)
{
}
}
public void RecoContext_VUMeter(int StreamNumber, object StreamPosition, int e)
{
int hg = e;
}
}
}
类的调用
hhh = new SpRecognition(file); 定义好的语法XML文件
hhh.BeginRec(textBox10); 关联到显示识别结果的控件
本文来自CSDN博客,转载请标明出处:http://blog.csdn.net/yincheng01/archive/2009/01/13/3764736.aspx
百度
语音识别
.zip_
C#
百度 语音_c
语音识别
_百度语音_
语音识别
_
语音识别
C
C#
百度官方
例子
,可以学习百度提供的基本的关于
语音识别
的方法,了解基本的
语音识别
的思路,为
语音识别
做好基础
C#
语音识别
,
C#
文本朗读程序
在本文中,我们将深入探讨如何使用
C#
进行
语音识别
和文本朗读,这两个技术在现代软件
开发
中扮演着重要角色,特别是在人机交互和无障碍功能方面。
C#
是一种由微软
开发
的面向对象的编程语言,它提供了丰富的库和API来...
winform
语音识别
和语音合成demo
这个“winform
语音识别
和语音合成demo”项目为我们提供了一个直观的
例子
,展示了如何将这些技术集成到桌面应用程序中,包括自动创建Word文档并将语音转化为文字,以及支持朗读、暂停和重读的语音合成功能。...
C#
语音识别
示例源码
1. **SpeechRecognitionEngine**:这是
C#
语音识别
的核心类,它提供了一种方法来识别从麦克风或其他音频输入设备捕获的声音。通过创建SpeechRecognitionEngine实例并配置它,你可以设置语言、音频输入源和识别模式。 ...
用
C#
实现文本朗读和
语音识别
功能
以下是一个基础的
语音识别
例子
: ```csharp using System.Speech.Recognition; public class SpeechToText { public string Recognize() { SpeechRecognitionEngine recognizer = new SpeechRecognitionEngine...
.NET Framework
17,748
社区成员
24,324
社区内容
发帖
与我相关
我的任务
.NET Framework
.NET技术 .NET Framework
复制链接
扫一扫
分享
社区描述
.NET技术 .NET Framework
社区管理员
加入社区
获取链接或二维码
近7日
近30日
至今
加载中
查看更多榜单
社区公告
暂无公告
试试用AI创作助手写篇文章吧
+ 用AI写文章