Wurschtbrot Posted July 2, 2008 Share Posted July 2, 2008 (edited) i use a pretty small / and easy to use script i have a problem with it it does wait till speak is complete wich i dont want ..... i want to sent the command to the api and resume script asap without having to wait for the end of the tts Speak("Test") Exit 1 Func Speak($oSpeech_msg) Local $oSpeech = ObjCreate("SAPI.SpVoice") If ISObj($oSpeech) Then $oSpeech.Speak($oSpeech_msg) EndFunc i want it to speak the word test and exit instandly ^^ without waiting for the tts speaker to finish the text any idea ? Edited July 2, 2008 by Wurschtbrot Link to comment Share on other sites More sharing options...
monoceres Posted July 2, 2008 Share Posted July 2, 2008 Hi!I extracted the code you needed form ProgAndys SAPI example, hereGlobal Enum Step *2 $SPF_ASYNC, _ $SPF_PURGEBEFORESPEAK, _ $SPF_IS_FILENAME, _ $SPF_IS_XML, _ $SPF_IS_NOT_XML, _ $SPF_PERSIST_XML, _ $SPF_NLP_SPEAK_PUNC, _ $SPF_NLP_MASK, _ $SPF_VOICE_MASK, _ $SPF_UNUSED_FLAGS Global $m_speakFlags = BitOR($SPF_ASYNC,$SPF_PURGEBEFORESPEAK) Global $voice = ObjCreate("SAPI.SpVoice") $voice.Speak("hello8888",$m_speakFlags) Msgbox(0,"","") Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
ChrisL Posted July 2, 2008 Share Posted July 2, 2008 So just to clarify, you want the script to exit before the word test is finished? So presumably if it were reciting a long line of text you want the script to end but the speach to carry on? If so, I think your out of luck [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
Wurschtbrot Posted July 2, 2008 Author Share Posted July 2, 2008 So just to clarify, you want the script to exit before the word test is finished?So presumably if it were reciting a long line of text you want the script to end but the speach to carry on?If so, I think your out of luckit has to "continue the script" exit was just a example ^^ i dont want it to wait for the speaker to finish his talk gonna try the stuff in 1st reply now Link to comment Share on other sites More sharing options...
Wurschtbrot Posted July 2, 2008 Author Share Posted July 2, 2008 Hi! I extracted the code you needed form ProgAndys SAPI example, here Global Enum Step *2 $SPF_ASYNC, _ $SPF_PURGEBEFORESPEAK, _ $SPF_IS_FILENAME, _ $SPF_IS_XML, _ $SPF_IS_NOT_XML, _ $SPF_PERSIST_XML, _ $SPF_NLP_SPEAK_PUNC, _ $SPF_NLP_MASK, _ $SPF_VOICE_MASK, _ $SPF_UNUSED_FLAGS Global $m_speakFlags = BitOR($SPF_ASYNC,$SPF_PURGEBEFORESPEAK) Global $voice = ObjCreate("SAPI.SpVoice") $voice.Speak("hello8888",$m_speakFlags) Msgbox(0,"","") this is perfect even tho id prefer it not to stop but it is ok already can u explain the variable im pretty new to api`s / or objekts Link to comment Share on other sites More sharing options...
ChrisL Posted July 2, 2008 Share Posted July 2, 2008 it has to "continue the script" exit was just a example ^^ i dont want it to wait for the speaker to finish his talk gonna try the stuff in 1st reply now Well yes the method posted by monoceres should allow you to continue, but if you exit the speach will stop [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
monoceres Posted July 2, 2008 Share Posted July 2, 2008 this is perfect even tho id prefer it not to stop but it is ok already can u explain the variable im pretty new to api`s / or objektsAs you will learn if you dig deeper into interacting with the windows api, msdn is your best friend.Here's the msdn links that was used in the example:http://msdn.microsoft.com/en-us/library/ms720570(VS.85).aspxhttp://msdn.microsoft.com/en-us/library/ms719820(VS.85).aspxhttp://msdn.microsoft.com/en-us/library/ms717252(VS.85).aspxGood luck! Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Wurschtbrot Posted July 2, 2008 Author Share Posted July 2, 2008 Well yes the method posted by monoceres should allow you to continue, but if you exit the speach will stop well i wont exit i will use it for audio output while a makro, and a little tts for my little brother, hes not that good @ reading Global Enum Step *2 $SPF_ASYNC, _ $SPF_PURGEBEFORESPEAK, _ $SPF_IS_FILENAME, _ $SPF_IS_XML, _ $SPF_IS_NOT_XML, _ $SPF_PERSIST_XML, _ $SPF_NLP_SPEAK_PUNC, _ $SPF_NLP_MASK, _ $SPF_VOICE_MASK, _ $SPF_UNUSED_FLAGS Global $m_speakFlags = BitOR($SPF_ASYNC,$SPF_PURGEBEFORESPEAK) Global $voice = ObjCreate("SAPI.SpVoice") If ISObj($voice) Then $voice.Speak("Text in Sprache Aktiviert.",$m_speakFlags) Else ToolTip("Text in Sprache Deaktiviert.") Sleep(2500) ToolTip("") exit 1 EndIf While 1 $oldget = ClipGet() Sleep(100) if ClipGet() <> $oldget Then if ClipGet() <> "" then Speak(ClipGet()) EndIf WEnd Func Speak($oSpeech_msg) $voice.Speak($oSpeech_msg,$m_speakFlags) EndFunc wont post the makro/script tho its 1.21 mb big already atm i have a gui wich i will kick out for this maybe on / off func that it wont bugg me so much ^^ Link to comment Share on other sites More sharing options...
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