Thread: Speech
View Single Post
Old 03-15-2003   #2 (permalink)
PRoSPeRe
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 07:59 AM.
PRoSPeRe is offline   Reply With Quote