miki Posted August 28, 2006 Share Posted August 28, 2006 I am thinking about the best way to realize this idea. I have my .au3 script called SCRIPT1 with his continue loop. Inside this loop I wait for a condition that happens. I would like after the condition happens to play a sound with continuity. In the same time I want that the main SCRIPT1 continue without waiting the stop of the sound. Maybe the main SCRIPT1 can call another .au3 script like this one (script2.au3)? script2.au3 While(1) SoundPlay("C:\Windows\media\notify.wav",1) sleep(1000) Wend Or maybe there is a best way? Thanks for all suggestion Link to comment Share on other sites More sharing options...
Valuater Posted August 28, 2006 Share Posted August 28, 2006 SoundPlay("C:\Windows\media\notify.wav") 8) Link to comment Share on other sites More sharing options...
miki Posted August 28, 2006 Author Share Posted August 28, 2006 (edited) SoundPlay("C:\Windows\media\notify.wav") 8) Thanks, now I read in the help for SoundPlay SoundPlay ( "filename" [, wait] ) [optional] This flag determines if the script should wait for the sound to finish before continuing: 1 = wait until sound has finished 0 = continue script while sound is playing (default) But I want to have a continuos sound like in the script While(1) SoundPlay("C:\Windows\media\notify.wav",1) sleep(1000) Wend P.S. the duration of notify.wav is about 1 sec. Thanks again Edited August 28, 2006 by miki Link to comment Share on other sites More sharing options...
ChrisL Posted August 28, 2006 Share Posted August 28, 2006 Write the sound play code to a temp au3 file and run it while your main sript does it's thing. $File = FileOpen ("myTempFile.au3",2) FileWriteline ($File, 'While(1)') FileWriteline ($File, 'SoundPlay("C:\Windows\media\notify.wav",1)') FileWriteline ($File, 'sleep(1000)') FileWriteline ($File, 'Wend') FileClose ($File) $Process = Run (@AutoItExe & ' /AutoIt3ExecuteScript myTempFile.au3') ;The rest of your script goes here and when your done you close the process of the temp file ProcessClose($Process) FileDelete("myTempFile.au3") [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...
miki Posted August 28, 2006 Author Share Posted August 28, 2006 Write the sound play code to a temp au3 file and run it while your main sript does it's thing. $File = FileOpen ("myTempFile.au3",2) FileWriteline ($File, 'While(1)') FileWriteline ($File, 'SoundPlay("C:\Windows\media\notify.wav",1)') FileWriteline ($File, 'sleep(1000)') FileWriteline ($File, 'Wend') FileClose ($File) $Process = Run (@AutoItExe & ' /AutoIt3ExecuteScript myTempFile.au3') ;The rest of your script goes here and when your done you close the process of the temp file ProcessClose($Process) FileDelete("myTempFile.au3") This is real interesting for me. Thanks Link to comment Share on other sites More sharing options...
marfdaman Posted August 28, 2006 Share Posted August 28, 2006 Or: AdlibEnable("Play", 1000) While 1 Sleep(100000) WEnd Func Play() SoundPlay("C:\Windows\media\notify.wav") EndFunc Don't take my pic to serious...~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~You Looked, but you did not see!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Link to comment Share on other sites More sharing options...
Xenobiologist Posted August 28, 2006 Share Posted August 28, 2006 Hi, you can also Fileinstall the soundplaying exe. This way it will run also on pcs without having installed Autoit. So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
ChrisL Posted August 29, 2006 Share Posted August 29, 2006 Hi,you can also Fileinstall the soundplaying exe. This way it will run also on pcs without having installed Autoit. So long,MegaYou don't need autoit installed for my method, because it uses the autoit exe which is compiled in your main script [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...
Moderators SmOke_N Posted August 29, 2006 Moderators Share Posted August 29, 2006 (edited) You don't need autoit installed for my method, because it uses the autoit exe which is compiled in your main scriptI think @ScriptFullPath (other than @AutoIt.exe) works there too... If I'm not mistaken. Edited August 29, 2006 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. 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