发布网友 发布时间:2022-04-25 08:23
共1个回答
热心网友 时间:2023-11-08 21:12
Const SSFMCreateForWrite = 3
Private Sub Form_Load()
strText = "测试文本"'这里输入要输出的声音
Set objVoice = CreateObject("SAPI.SpVoice")
Set objFile = CreateObject("SAPI.SpFileStream.1")
objFile.Open "D:\测试声音.wav", SSFMCreateForWrite'输出路径
Set objVoice.AudioOutputStream = objFile
objVoice.Rate = 1
objVoice.Volume = 100'音量
objVoice.AllowAudioOutputFormatChangesOnNextSet = False
objVoice.Speak strText
objFile.Close
Set objVoice.AudioOutputStream = Nothing
Set objVoice = Nothing
End Sub
英文也可以输出
注意需要引用Microsoft Speech Object Library库
望采纳
热心网友 时间:2023-11-08 21:12
Const SSFMCreateForWrite = 3
Private Sub Form_Load()
strText = "测试文本"'这里输入要输出的声音
Set objVoice = CreateObject("SAPI.SpVoice")
Set objFile = CreateObject("SAPI.SpFileStream.1")
objFile.Open "D:\测试声音.wav", SSFMCreateForWrite'输出路径
Set objVoice.AudioOutputStream = objFile
objVoice.Rate = 1
objVoice.Volume = 100'音量
objVoice.AllowAudioOutputFormatChangesOnNextSet = False
objVoice.Speak strText
objFile.Close
Set objVoice.AudioOutputStream = Nothing
Set objVoice = Nothing
End Sub
英文也可以输出
注意需要引用Microsoft Speech Object Library库
望采纳
热心网友 时间:2023-11-08 21:12
Const SSFMCreateForWrite = 3
Private Sub Form_Load()
strText = "测试文本"'这里输入要输出的声音
Set objVoice = CreateObject("SAPI.SpVoice")
Set objFile = CreateObject("SAPI.SpFileStream.1")
objFile.Open "D:\测试声音.wav", SSFMCreateForWrite'输出路径
Set objVoice.AudioOutputStream = objFile
objVoice.Rate = 1
objVoice.Volume = 100'音量
objVoice.AllowAudioOutputFormatChangesOnNextSet = False
objVoice.Speak strText
objFile.Close
Set objVoice.AudioOutputStream = Nothing
Set objVoice = Nothing
End Sub
英文也可以输出
注意需要引用Microsoft Speech Object Library库
望采纳