![]() |
|
|
#1 (permalink) |
|
Registered Member
Join Date: Nov 2002
Posts: 6
|
Speech
Ok I'm not going to post my entire script because my script is a combination of several scripts so it'd get confusing. But I will post a little info on this.
Insert this code at the beginning of the script: Code:
Dim TTSControl
Set TTSControl = CreateObject("Speech.VoiceText")
TTSControl.Register "", nameScript
Function TTS (whattosay)
TTSControl.Speak whattosay, 1
End Function
Now in the rest of your code all you need to do to make it talk is put the line tts "Stuff you want to be annoyed by here" If you can't get this to work you most likely don't have the Microsoft SAPI installed get that http://activex.microsoft.com/activex...pi/spchapi.exe This isn't really very useful at the moment for anything but annoying the crap out of you. But when future versions of netstumbler come out hopefully the OnScanResult event will be working and this script will make it possible to give you the name and other attributes whenever a new SSID is found. I am in no way responsible for insanity caused by annoying computer voices. |
|
|
|
|
|
#2 (permalink) |
|
Registered Member
Join Date: Mar 2003
Posts: 2
|
I tryed your script :
--------------------------------------------------- Dim TTSControl Set TTSControl = CreateObject("Speech.VoiceText") TTSControl.Register "", nameScript Function TTS (whattosay) TTSControl.Speak whattosay, 1 End Function Sub OnEnableScan () TTS "test" End Sub --------------------------------------------------- But I have got an error line 3 char 1 .... So I have transformed the VBScript in JScript just for the fun --------------------------------------------------- function OnEnableScan () { var vt = CreateObject("Speech.VoiceText"); vt.Register("", ScriptName); vt.Speak("Scan Activated", 1); while ( vt.IsSpeaking ) Sleep(100); } --------------------------------------------------- I've got an another error. However when I try to execute this as a standalone script : var vt = WScript.CreateObject("Speech.VoiceText"); vt.Register("", WScript.ScriptName); vt.Speak("Scan Activated", 1); while ( vt.IsSpeaking ) WScript.Sleep(100); Everything is OK ... I think the problem is the register method ... Somebody can help me please ? Last edited by PRoSPeRe : 03-16-2003 at 06:59 AM. |
|
|
|
|
|
#4 (permalink) |
|
Registered Member
Join Date: Jun 2003
Location: Florida, somewhere near JamLando
Posts: 2
|
speech
I had an issue as well, but it was with getting the script to actually speak when executed as stand-alone. I put a message box in there to confirm some variables, and - there was the voice. That's how I'm pullin' the voice out of VBScript, with a message box. I haven't investigated the mechanics of it yet
, I was just curiouse to try it out. Maybe it has something to do with the sound buffer? Hmm... Here's the code (based on the above):Dim objTTS Set objTTS = CreateObject("Speech.VoiceText") objTTS.Register "", wscript.scriptname objTTS.Speak "Hello Vee Bee Script World!", 1 msgbox "Hello Vee Bee Script World!", vbInformation + vbOkOnly, "Hello!" Last edited by etM : 06-18-2003 at 10:35 PM. |
|
|
|
|
|
#5 (permalink) |
|
Registered Member
Join Date: Jun 2003
Location: Florida, somewhere near JamLando
Posts: 2
|
speech - code revision!
Turns out the message box extended the execution life of the script. In other words, the speech control will only output while the script is still being executed, so you have to program the script to check the isSpeaking property for false before exiting
. Turns out I fixed it myself. It's here for your reference if you happened to have this problem yourself:sub Shout(theText) Dim objTTS Set objTTS = CreateObject("Speech.VoiceText") objTTS.Register "", wscript.scriptname ' Shout it out. objTTS.Speak theText, 1 while objTTS.isSpeaking ' And wait patiently for cleaning cycle to end. wscript.sleep(500) wend end sub thanx to generation5.org for the ideas. |
|
|
|