VB5如何使用微软的Text-to-Speech引擎
编号:QA002741
建立日期: 2000年3月19日 最后修改日期:2002年4月22日
所属类别:
Rick:
操作系统:win98
编程工具:vb5
问题:vb5如何使用微软的Text-to-Speech引擎?
回答:
(主持人注:在运行下面的代码前需要先选择菜单“工程|引用”,在对话框中选择Voice Text Object Library。)
Dim vText As New VTxtAuto.VTxtAuto
Private Sub Command1_Click()
Dim astr As String
Command1.Enabled = False
vText.Register vbNullString, "Rick"
astr = "This is a sample of Microsoft Speech Engine?"
vText.Speak astr, vtxtsp_NORMAL Or vtxtst_QUESTION
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set vText = Nothing
End Sub
(主持人注:关于这个对象的更详细介绍可以参考MSDN Libaray中的文章《A High-Level Look at Text-to-Speech via the Microsoft Voice Text Object》)
相关问题:
QA001257 "怎么将汉字翻译成汉语拼音"
此问题由Rick回答。
| |
|
|
| |
|
|