R.L. Posted July 5, 2004 Posted July 5, 2004 (edited) Using this little 3rd party freeware commandline test to speech tool called TimeTeller (only 11kb, freeware, freely distributable for non commercial purpose): http://www.kokpeter.dds.nl/Download/index.htm#TimeTeller(you need to have vb and MS TTS engine to run it, XP has both by default but not 9x)I made a script to quickly read the text you highligted. With this script, you PC will speak whatever you highlighted immediately with a keypress to the <PrintScreen> button (it will also send the text to the clipboard). And if you want it to stop reading, just press the <Printscreen> button again. To quit the script, just press <f2>. To run the script, put TimeTeller as TT.exe in the same directory as your script; or you can download the whole thing here and upzip itNonosenseTTS.zip(107kb) expandcollapse popup$G_SZVERSION = "ClipSpeak" If WinExists($G_SZVERSION) Then Exit EndIf AutoItWinSetTitle($G_SZVERSION) Global $TOREAD Global $COMMAND = "TT.exe now" ToolTip("Press <Printscreen> to toggle start and stop speaking, <f2> to quit.", 10, 0) Sleep(2000) ClipPut("Please highlight some text and press the prinnd screen button.") Call("speakclip") HotKeySet("{printscreen}", "toggle") HotKeySet("{f2}", "quit") While 1 sleep (500) Wend Func toggle() $PROCESS = ProcessExists("tt.exe") Select Case $PROCESS Not = 0 Call("stopspeak") Case $PROCESS = 0 Call("clipplace") EndSelect EndFunc ;==>toggle Func clipplace() BlockInput(1) Send("{CTRLDOWN}{c}{CTRLup}") BlockInput(0) $LENGTH = ClipGet() If StringLen($LENGTH) > 1 Then Call("speakclip") EndFunc ;==>clipplace Func speakclip() ToolTip("Press <Printscreen> to toggle start and stop speaking, <f2> to quit.", 10, 0) $TOREAD = ClipGet() $TOREA0 = StringReplace($TOREAD, "<", "", 0, 1) $TOREAD0 = StringReplace($TOREA0, ">", "", 0, 1) $TOREAD1 = StringReplace($TOREAD0, '"', "", 0, 1) $TOREAD2 = ' " ' & $TOREAD1 & ' " ' Run($COMMAND & $TOREAD2) Sleep(4000) ToolTip("", 0, 0) EndFunc ;==>speakclip Func stopspeak() ToolTip("Not speaking", 10, 0) ProcessClose("tt.exe") $STATUS = "notset" Sleep(4000) ToolTip("Press <Printscreen> to toggle start and stop speaking, <f2> to quit.", 10, 0) Sleep(2000) ToolTip("", 0, 0) EndFunc ;==>stopspeak Func quit() ProcessClose("tt.exe") Exit EndFunc ;==>quit I use it to speak my text when my eyes are tired Edited July 6, 2004 by R.L. R.L.A few pieces made with new GUI enabled AutoIt
emmanuel Posted July 6, 2004 Posted July 6, 2004 ok, that was fun. have it read this: <> for some reason, it reads the date and time when it gets to "<>" then continues on. oh well, why would i really want to playback code with this thing anyways? nifty toy. "I'm not even supposed to be here today!" -Dante (Hicks)
pekster Posted July 6, 2004 Posted July 6, 2004 Just one small note in your code. For your infinate while loop, you should put a small pause in there so that you don't end up using all avaiable CPU cycles doing nothing. [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.
emmanuel Posted July 6, 2004 Posted July 6, 2004 you mean, like how it's using 98% of my CPU right now... vs another script with just a sleep 250 in it that's not burning any cpu? ouch. "I'm not even supposed to be here today!" -Dante (Hicks)
R.L. Posted July 6, 2004 Author Posted July 6, 2004 Just one small note in your code. For your infinate while loop, you should put a small pause in there so that you don't end up using all avaiable CPU cycles doing nothing.Do you mean using the "sleep" function like this? While 1 sleep (100) Wend Or it should be done differently? R.L.A few pieces made with new GUI enabled AutoIt
R.L. Posted July 6, 2004 Author Posted July 6, 2004 ok, that was fun. have it read this: for some reason, it reads the date and time when it gets to "<>"oh yes , the third party tt.exe was designed to read time (I included the TTreadme, in the package). So, when it sees strange thing, it will just read the time. R.L.A few pieces made with new GUI enabled AutoIt
emmanuel Posted July 6, 2004 Posted July 6, 2004 Do you mean using the "sleep" function like this? While 1 sleep (100) Wend Or it should be done differently?that's exactly it, though on mine I made it 500, since it's just there to hold the app open, it doesn't need to be as fast as every 100... "I'm not even supposed to be here today!" -Dante (Hicks)
R.L. Posted July 6, 2004 Author Posted July 6, 2004 Thanks for the tips, bug fixed (next time certainly remember to switch on the task manager to test my script ) R.L.A few pieces made with new GUI enabled AutoIt
emmanuel Posted July 6, 2004 Posted July 6, 2004 yeah, I didn't actually notice that it was sucking 95-98% cpu till pekster posted about it... guess it was early enough I wasn't using my computer much "I'm not even supposed to be here today!" -Dante (Hicks)
pekster Posted July 6, 2004 Posted July 6, 2004 that's exactly it, though on mine I made it 500, since it's just there to hold the app open, it doesn't need to be as fast as every 100...Even a 10 milisecond sleep will save the CPU from a good part of it's load. If you know you don't need to detect anything more than half a second, set it at 500 or higher as required. But some amount in there will prevent it from stealing all the time when the token comes around. [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.
R.L. Posted July 6, 2004 Author Posted July 6, 2004 ok, that was fun. have it read this: for some reason, it reads the date and time when it gets to "<>" then continues on. hmm...this one fixed now,too ...wonder what other characters would be in the group... from this $TOREAD = ClipGet() $TOREAD1 = StringReplace($TOREAD, '"', "", 0, 1) $TOREAD2 = ' " ' & $TOREAD1 & ' " ' ' to this $TOREAD = ClipGet() $TOREA0 = StringReplace($TOREAD, "<", "", 0, 1) $TOREAD0 = StringReplace($TOREA0, ">", "", 0, 1) $TOREAD1 = StringReplace($TOREAD0, '"', "", 0, 1) $TOREAD2 = ' " ' & $TOREAD1 & ' " ' I didn't actually notice that it was sucking 95-98% cpu till pekster posted about it... guess it was early enough I wasn't using my computer muchI remember my TclockEX (displays date in sysclock) used to also show CPU usage in my 98, but no more after upgraded to XP. It was handy. R.L.A few pieces made with new GUI enabled AutoIt
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now