Jump to content
Sign in to follow this  
Koda

Speak, my first real script

Recommended Posts

Koda

How come this doesn't work? I'm getting an error that says $voice is not yet defined. What should I do?

speak.au3


America spent thousands of dollars to make a pen that will work in space.Russia used a pencil.

Share this post


Link to post
Share on other sites
BigDod

My example

;Speak("text to speak", 1-10 rate of speaking,
;0 - 100 Colume
$input=InputBox("Text to Speak", "Type Text")
Dim $voice = ObjCreate("Sapi.SpVoice")
Func Speak($Text, $Rate, $Vol) 
$voice.Rate = $Rate
$voice.Volume = $Vol
$voice.Speak($Text)
EndFunc
Speak($input, 1, 100)


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites
Koda

I like that, but is there any way to have it so an inputbox does not come up? Meaning that you edit what is spoken in the script, and it automatically says it?


America spent thousands of dollars to make a pen that will work in space.Russia used a pencil.

Share this post


Link to post
Share on other sites
BigDod

;Speak("text to speak", 1-10 rate of speaking,
;0 - 100 Colume
$input="hello"
Dim $voice = ObjCreate("Sapi.SpVoice")
Func Speak($Text, $Rate, $Vol) 
$voice.Rate = $Rate
$voice.Volume = $Vol
$voice.Speak($Text)
EndFunc
Speak($input, 1, 100)

Edited by BigDod


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×