I have the following VBScript code for text to speech conversion:
Set objVoice = CreateObject("SAPI.SpVoice")
objVoice.Speak Inputbox("Enter Text")
I want to save the speech to an audio file. How can I do this?
I have the following VBScript code for text to speech conversion:
Set objVoice = CreateObject("SAPI.SpVoice")
objVoice.Speak Inputbox("Enter Text")
I want to save the speech to an audio file. How can I do this?
You can save the SAPI output to a .WAV file as follows:
Create and open a .WAV file as a stream using the
SpFileStream.Open
method.Assign this file stream to the
SpVoice.AudioStream
property.Here's an example: