Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Const SapiFileType=18 ' Magic number, possibly voice specific (0 to 64)
- strText=Trim(InputBox("What do you want me to say?","Listen to Sapi.SpFileStream.Format.Type Quality",""))
- If NOT len(strText)>0 Then WScript.Quit
- With CreateObject("Scripting.FileSystemObject")
- strFile=.BuildPath(.GetParentFolderName(WScript.ScriptFullName),"Sapi.SpFileStream.Format.Type_"&SapiFileType&".wav")
- If .FileExists(strFile) Then .DeleteFile strFile
- End With
- With CreateObject("Sapi.SpVoice")
- Set ss=CreateObject("Sapi.SpFileStream")
- ss.Format.Type=SapiFileType
- ss.Open strFile,3,False
- Set .AudioOutputStream=ss
- .Speak strText,8
- .waituntildone(-1)
- ss.Close
- Set ss=Nothing
- End With
- With CreateObject("WMPlayer.OCX"):.settings.autoStart=True:.settings.volume=100:.URL=strFile:Do until .playState=1:Wscript.Sleep 200:Loop:End With
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement