2 u014186406 u014186406 于 2015.05.30 18:10 提问

关于vs2010中SpeechLib库语音播报功能

出现异常“没有注册类 (异常来自 HRESULT:0x80040154 (REGDB_E_CLASSNOTREG))”,该怎么处理

2个回答

u014186406
u014186406   2015.05.30 18:26

代码

public void Speak(string item)
{
SpVoice voice = new SpVoice();
voice.Rate = -2;
voice.Voice = voice.GetVoices(string.Empty, string.Empty).Item(0);
voice.Speak(item, SpeechVoiceSpeakFlags.SVSFDefault);
}

                    private void button1_Click(object sender, EventArgs e)
    {
        for (int i = 0; i < dataGridView1.RowCount - 1; i++)
        {
            string name = dataGridView1.Rows[i].Cells[0].ToString();
            Speak(name);
        }

    }
u014186406
u014186406   2015.05.30 18:25

代码

public void Speak(string item)
{
SpVoice voice = new SpVoice();
voice.Rate = -2;
voice.Voice = voice.GetVoices(string.Empty, string.Empty).Item(0);
voice.Speak(item, SpeechVoiceSpeakFlags.SVSFDefault);
}

                    private void button1_Click(object sender, EventArgs e)
    {
        for (int i = 0; i < dataGridView1.RowCount - 1; i++)
        {
            string name = dataGridView1.Rows[i].Cells[0].ToString();
            Speak(name);
        }

    }
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!