James Posted June 14, 2007 Posted June 14, 2007 (edited) Hey,Bored, and I couldn't be bothered to read a webpage so I decided I would make my computer do all the work.expandcollapse popup#include <Misc.au3> HotKeySet("^t", "_Talk") HotKeySet("^e", "_Exit") HotKeySet("^r", "_Stop") Global $voice = ObjCreate("Sapi.SpVoice") Local $Talk = 0 While 1 Sleep(100) WEnd Func _Talk() $Clip = ClipGet() Do Speak($Clip, 0, 100) $Talk = 1 Until $Talk = 1 Or _IsPressed(12) & _IsPressed(53) EndFunc ;==>_Talk Func _Stop() $voice = ObjCreate("Sapi.SpVoice") EndFunc Func Speak($text, $Rate, $Volme) Local Const $SVSFlagsAsync = 1 If IsObj($voice) Then $voice.Voice = $voice.GetVoices("Name=Microsoft Sam", "Language=409").Item(0) $voice.Rate = $Rate $voice.Volume = $Volme $voice.Speak ($text, $SVSFlagsAsync) EndIf EndFunc ;==>Speak Func _Exit() Exit EndFunc ;==>_ExitI cant make a stop function but I did try.Any comments/suggestions, welcome!Thanks,JamesEdit: Thanks to Cyber for the stop function which he found and added Edited June 15, 2007 by Secure_ICT Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
lordofthestrings Posted June 14, 2007 Posted June 14, 2007 (edited) I saw Lazyreader here a while ago.. it does the same thing.. interact with the speech application programming interface.. (the stop function Lazy reader uses is hotkeyset) (--edit -- but Now I see that you allready use it like this) I hope this helps.. I love this API.. kind regards, Edited June 14, 2007 by lordofthestrings
James Posted June 14, 2007 Author Posted June 14, 2007 Thanks Strings! I will take a look at it, see if I can get it to stop reading. Thanks, James Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
zfisherdrums Posted June 15, 2007 Posted June 15, 2007 (edited) Secure_ICT, Great minds think alike? Funny how we have the exact same idea although mine was more of a joke (ie, trying to make it appear to be this "amazing" piece of software when it really isn't). Anyway, the only way I was able to get it to stop talking was by running the speech object in a separate script. Were you able find a different way of doing it? zfisherdrums... Edited June 15, 2007 by zfisherdrums Identify .NET controls by their design time namesLazyReader© could have read all this for you. Unit Testing for AutoItFolder WatcherWord Doc ComparisonThis here blog...
ConsultingJoe Posted June 15, 2007 Posted June 15, 2007 (edited) I made this also, I'm not sure if I posted it but here: Just select text and Ctrl+` to speak. HotKeySet( "^`", "speak" ) While 1 Sleep(10) WEnd Func speak() Send("^c") _TalkOBJ( ClipGet(), 2 ) EndFunc Func _TalkOBJ($s_text, $s_voice = 3) Local $quite = 0 Local $o_speech = ObjCreate("SAPI.SpVoice") Select Case $s_voice == 0 Return Case $s_voice == 1 $o_speech.Voice = $o_speech.GetVoices ("Name=Microsoft Mary", "Language=409").Item (0);female Case $s_voice == 2 $o_speech.Voice = $o_speech.GetVoices ("Name=Microsoft Mike", "Language=409").Item (0);male Case $s_voice == 3 $o_speech.Voice = $o_speech.GetVoices ("Name=Microsoft Sam", "Language=409").Item (0);sam EndSelect $o_speech.Speak ($s_text) $o_speech = "" Sleep(1000) TrayTip("", "", 1) EndFunc ;==>_TalkOBJ BTW: There is a way to stop it, I had it, try searching through the topics. someone told me once. I'll find it tomorrow if you don't Edited June 15, 2007 by CyberZeroCool Check out ConsultingJoe.com
James Posted June 15, 2007 Author Posted June 15, 2007 @zfisherdrums: Lol, I'm just to lazy to read. Its easier for me to make this than to read. @Cyber: I couldn't find it. I have been looking before hand for BetaPad. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
i542 Posted June 15, 2007 Posted June 15, 2007 Secure_ICT said: I will take a look at it, see if I can get it to stop reading.Don't hope, I tried to find it for Talk2Me but nothing. I can do signature me.
James Posted June 15, 2007 Author Posted June 15, 2007 I searched for: Sapi.spvoice functions tts help Nothing. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
lordofthestrings Posted June 15, 2007 Posted June 15, 2007 (edited) you're not looking for SAPI Functions, but methodsthe speech api returns an object..This object exposes it's methods (you can see this by using primalscript or vb IDE)read this article from the M$ scripting guys...http://www.microsoft.com/technet/scriptcen...games/sapi.mspx Edited June 15, 2007 by lordofthestrings
James Posted June 15, 2007 Author Posted June 15, 2007 Well if you want to stop it, you will probably need an API call. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
A. Percy Posted June 15, 2007 Posted June 15, 2007 (edited) In my old UDF for manage MSAgent, I have a function _MAStop() that stop any action from char.I think you can call anything like ".Stop" to do itSee MsAgentLib Edited June 15, 2007 by A. Percy Só o que posso lhe dizer, bom é quando faz mal!My work:Au3Irrlicht - Irrlicht for AutoItMsAgentLib - An UDF for MSAgentAu3GlPlugin T2 - A 3D plugin for AutoIt...OpenGl Plugin - The old version of Au3GlPlugin.MAC Address Changer - Changes the MAC AddressItCopter - A dragonfly R/C helicopter simulator VW Bug user Pinheiral (Pinewood) city: http://pt.wikipedia.org/wiki/Pinheiral
James Posted June 15, 2007 Author Posted June 15, 2007 Thanks Percy! Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
i542 Posted June 15, 2007 Posted June 15, 2007 Secure_ICT said: Thanks Percy!Yeah, thanks Percy! I can do signature me.
James Posted June 15, 2007 Author Posted June 15, 2007 I actually looked at that earlier, but I thought if I searched harder then there maybe another way. Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
ConsultingJoe Posted June 15, 2007 Posted June 15, 2007 I Found it. I updated your script with it. Use Ctrl+r to stopTopic on it is here: http://www.autoitscript.com/forum/index.ph...st&p=221119to pause and resume use $speak.pause() and $speak.resume() but to stop just recreate the object itself.to allow the script to continue while speaking you must use: $voice.Speak ($text, 1)I hope this helps everyone.expandcollapse popup#include <Misc.au3> HotKeySet("^t", "_Talk") HotKeySet("^e", "_Exit") HotKeySet("^r", "_Stop") Global $voice = ObjCreate("Sapi.SpVoice") Local $Talk = 0 While 1 Sleep(100) WEnd Func _Talk() $Clip = ClipGet() Do Speak($Clip, 0, 100) $Talk = 1 Until $Talk = 1 Or _IsPressed(12) & _IsPressed(53) EndFunc ;==>_Talk Func _Stop() $voice = ObjCreate("Sapi.SpVoice") EndFunc Func Speak($text, $Rate, $Volme) Local Const $SVSFlagsAsync = 1 If IsObj($voice) Then $voice.Voice = $voice.GetVoices("Name=Microsoft Sam", "Language=409").Item(0) $voice.Rate = $Rate $voice.Volume = $Volme $voice.Speak ($text, $SVSFlagsAsync) EndIf EndFunc ;==>Speak Func _Exit() Exit EndFunc ;==>_Exit Check out ConsultingJoe.com
James Posted June 15, 2007 Author Posted June 15, 2007 Thankyou. No-one will look further. Cyber, you rock! Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
ConsultingJoe Posted June 15, 2007 Posted June 15, 2007 Secure_ICT said: Thankyou. No-one will look further. Cyber, you rock!Thank you,I just want to ask everyone to check out my new script: Protocol Managing Check out ConsultingJoe.com
James Posted June 15, 2007 Author Posted June 15, 2007 Lol, thats it Cyber, advertise your own project Blog - Seriously epic web hosting - Twitter - GitHub - Cachet HQ
ConsultingJoe Posted June 15, 2007 Posted June 15, 2007 Secure_ICT said: Lol, thats it Cyber, advertise your own project Thanks, I helped you, so I figured you wouldn't mind helping me. Thanks for the comment. Check out ConsultingJoe.com
i542 Posted June 15, 2007 Posted June 15, 2007 (edited) CyberZeroCool said: Thanks, I helped you, so I figured you wouldn't mind helping me. Thanks for the comment. Because advertise in existing thread (where you helped with something) is better than making new thread to advertise your new phone, Secure. (where you aren't helped a bit) Edited June 15, 2007 by i542 I can do signature me.
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