版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/chenlu5201314/article/details/87253505
'定义变量
Dim spv,s
'创建语音对象
Set spv=CreateObject("SAPI.SpVoice")
'语速
spv.Rate=1
'音量
spv.Volume=100
'语音
'Microsoft Huihui Desktop spv.GetVoices.Item(0)
'Microsoft Zira Desktop spv.GetVoices.Item(1)
Set spv.Voice=spv.GetVoices.Item(0)
'播放
spv.Speak "绍莫千华 Love Lucy"
'枚举语音
For Each token In spv.GetVoices
s=s & token.GetDescription & vbcrlf '
Next
MsgBox s