Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Const SAFT48kHz16BitStereo = 39
- Const SSFMCreateForWrite = 3 ' Creates file even if file exists and so destroys or overwrites the existing file
- Dim oFileStream, oVoice
- Dim message,mobilegaming
- Dim MessageBox, Title, Default, MyValue
- MessageBox = "Enter your Text" ' Set prompt.
- Title = "Text to Speech" ' Set title.
- message = InputBox(MessageBox, Title, Default, 100, 100)
- Set mobilegaming = CreateObject("SAPI.SpVoice")
- mobilegaming.Speak message
- Set oFileStream = CreateObject("SAPI.SpFileStream")
- oFileStream.Format.Type = SAFT48kHz16BitStereo
- oFileStream.Open "C:\Users\YOURUSERNAME\Desktop\1.mp3", SSFMCreateForWrite
- Set oVoice = CreateObject("SAPI.SpVoice")
- Set oVoice.AudioOutputStream = oFileStream
- oVoice.Speak message
- oFileStream.Close
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement