*!*
文字到 Wav 文件并朗读的 TTS 示例
loStream = Createobject("SAPI.SPFileStream")
loVoice = Createobject("Sapi.Spvoice")
** 创建 Wav 文件
Delete File SampleVoice.wav
loStream.Open("SampleVoice.wav", 3)
** Specify that the Audio from the voice is sent to the stream
loVoice.AudioOutputStream = loStream
loVoice.Voice = loVoice.GetVoices().Item(0)
&& 我的(0)是英文男声 Microsoft Sam
loVoice.Speak("This is me Reading this Information.")
loStream.Close
** 重置输出流
loVoice.AudioOutputStream = .Null.
** 打开要朗读的 WAV 文件
loStream.Open("SampleVoice.wav")
** 更改其他人的发声
*!*
loVoice.Voice = loVoice.GetVoices("GENDER=male").Item(0)
loVoice.Voice = loVoice.GetVoices().Item(3)
&& 我的(3)是中文女声,(0)可能是 Microsoft Sam
lovoice.speak("你好,我是团小组长,你好吗?Hello, the World.")
loVoice.SpeakStream(loStream)
loVoice.Speak("好的,Did that Really Sound Like Me?")