标题:程序找错(从文字到语音,)
取消只看楼主
mychenphotos
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2008-4-20
 问题点数:0 回复次数:0 
程序找错(从文字到语音,)
最近要做一个读取网页的程序.(从文字到语音),
下面我写的代码,引用了DoNetSpeech.dll.这个DLL是我们老师给我的.这程序能运行,但是不能读出webBrowser里面的内容,请指点.告诉我代码哪有错误.正确的应该是怎么样..拜托了.谢谢.  


using System;  
using System.Collections.Generic;  
using   
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();  
        }  
    }  
}
搜索更多相关主题的帖子: using 语音 System 文字 
2008-04-20 16:03



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-210067-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.450347 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved