碧空雪狐

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

【语音识别系统】下载地址:http://ishare.iask.sina.com.cn/f/7470929.html?from=like


一。建立一个新项目。解决方案如下(注意引用部分):

 

二.Form1后台代码如下:

 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DotNetSpeech;
using System.Text.RegularExpressions;

namespace WindowsFormsApplication4
{
public partial class Form1 : Form
{
public Form1 ( )
{
InitializeComponent( );
}

private void button1_Click ( object sender , EventArgs e )
{
//方式一:
//SpeechVoiceSpeakFlags spFlags = SpeechVoiceSpeakFlags.SVSFlagsAsync;
//SpVoice v = new SpVoice( );
//v.Rate = -3;
//int a = v.Speak( this.textBox1.Text , spFlags );

//方式二(可程序分配语音包的发音选择):
//SpVoiceClass voice = new SpVoiceClass( );
//voice.Voice = voice.GetVoices( string.Empty , string.Empty ).Item( 0 ); //其中3为中文,024为英文,根据个人电脑的语下载的音包分辨(控制面板→语音→ 语音选择)
//voice.Rate = -3;
//voice.Speak( this.textBox1.Text , SpeechVoiceSpeakFlags.SVSFlagsAsync );

}
}
}

 

 

posted on 2011-11-25 01:45  碧空雪狐  阅读(407)  评论(0编辑  收藏  举报