CNET中国旗舰网站

ZDNet China | CNET科技资讯网 | 政府采购 | 行业网站联盟





 
标题: [原创] 程序找错(从文字到语音)
mychenphotos
论坛游民




UID 320669
精华 0
积分 21
帖子 1
威望 10
ZD币 17 元
阅读权限 20
注册 2008-4-20
状态 离线
  楼主
发表于 2008-4-20 16:13  资料  个人空间  短消息  加为好友  添加 mychenphotos 为MSN好友 通过MSN和 mychenphotos 交谈
开发者在线

程序找错(从文字到语音)

最近要做一个读取网页的程序.(从文字到语音),
下面我写的代码,引用了DoNetSpeech.dll.这个DLL是我们老师给我的.这程序能运行,但是不能读出webBrowser里面的内容,请指点.告诉我代码哪有错误.正确的应该是怎么样..拜托了.谢谢.  


using System;  
using System.Collections.Generic;  
using System.ComponentModel;  
using System.Data;  
using System.Drawing;  
using System.Text;  
using System.Windows.Forms;  
using DoNetSpeech;  

namespace voice  
{  
    public partial class Form1 : Form  
    {  
        public static int Speakvoice;  
        SpeechVoiceSpeakFlags spFlags;  
        SpVoice voice;  
        public Form1()  
        {  
            InitializeComponent();  
            Speakvoice = 0;  
            spFlags = SpeechVoiceSpeakFlags.SVSFlagsAsync;  
            voice = new SpVoice();  
            voice.Voice = voice.GetVoices("", "").Item(0);  
            voice.Volume = 50;  
            voice.Rate = 5;  
        }  


        private void BackgroundProcess()  
        {  
            voice.Speak(string.Empty, SpeechVoiceSpeakFlags.SVSFPurgeBeforeSpeak);  
            voice.Volume = 50;  
            voice.Rate = 5;  
            voice.Voice = voice.GetVoices("", "").Item(0);  
            voice.Speak(webBrowser1.Text.ToString(), spFlags);  
        }  


        private void button1_Click(object sender, EventArgs e)  
        {  
            webBrowser1.Navigate(textBox1.Text.ToString());  
        }  

        private void button2_Click(object sender, EventArgs e)  
        {  
             BackgroundProcess();  
        }  
    }  
}




顶部
热点频道推荐: C/S开发| 数据库| WEB开发| 嵌入式| 项目管理|
 



当前时区 GMT+8, 现在时间是 2009-1-10 09:58

  Powered by Discuz! 5.5.0 © 2001-2007 Comsenz Inc.
Processed in 0.066188 second(s), 4/3 queries

清除 Cookies - 联系我们 - ZDNetChina中文社区 - 无图版