vb怎么调用系统tts朗读文本框里的内容?
1个回答
展开全部
先创建TTS对象,然后设置语言种类,设置音量,最后就是调用speak朗读文本框1中的内容,代码如下
Set objVoice = CreateObject("SAPI.SpVoice")
Set colVoice = objVoice.GetVoices()
objVoice.Volume = 100
For i = 0 To colVoice.Count - 1
If Right(colVoice(i).Id, Len("MSSimplifiedChineseVoice")) = "MSSimplifiedChineseVoice" Then cnVoice =i
Next
Set objVoice.Voice = colVoice.Item(cnVoice)
objVoice.Speak (text1.text)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询