Swift Posted January 18, 2008 Share Posted January 18, 2008 (edited) #NoTrayIcon #include <Sound.au3> $sound = "C:\Documents and Settings\Darin\Shared\Iron Maiden - Run To The Hills.mp3" _SoundOpen($sound) _SoundPlay($sound) supposted to run that song..why doesnt it work? EDIT: this doesnt work either #NoTrayIcon #include <Sound.au3> $soundfile = "C:\Documents and Settings\Darin\Shared\Iron Maiden - Run To The Hills.mp3" $sound = _SoundOpen($soundfile) _SoundPlay($sound) Edited January 18, 2008 by Swift Link to comment Share on other sites More sharing options...
Developers Jos Posted January 18, 2008 Developers Share Posted January 18, 2008 It works fine but your script end right away thus stops the sound as well. Make sure your script doesn't end or add the optional parameter to _SoundPlay() to tell it to wait till finished. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Swift Posted January 18, 2008 Author Share Posted January 18, 2008 haha...i could just add While 1 Wend....lol...but thanks forgot that part Link to comment Share on other sites More sharing options...
PsaltyDS Posted January 18, 2008 Share Posted January 18, 2008 (edited) Try it this way: #NoTrayIcon #include <Sound.au3> $sFile = "C:\Documents and Settings\Darin\Shared\Iron Maiden - Run To The Hills.mp3" ; Open sound file and save pointer to the sound $sound = _SoundOpen($sFile) ; Play the sound, wait for it to finish _SoundPlay($sound, 1) ; Close the sound _SoundClose($sound) Ack...! Beaten to it by the Jos-bot! Edited January 18, 2008 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Swift Posted January 18, 2008 Author Share Posted January 18, 2008 sweeeett!! just what i was looking for...lol...thanks Link to comment Share on other sites More sharing options...
Swift Posted January 18, 2008 Author Share Posted January 18, 2008 FileCopy(@ScriptDir & "\RunIronMaiden.au3", @StartupDir & "\RunIronMaiden.au3") HotkeySet("{END}", "exitall") #NoTrayIcon #include <Sound.au3> $sFile = "C:\Documents and Settings\Darin\Shared\Iron Maiden - Run To The Hills.mp3" $sound = _SoundOpen($sFile) Func exitall() _SoundClose($sound) Exit EndFunc _SoundPlay($sound, 1) _SoundClose($sound) Exit why doesnt this exit when you press end? Link to comment Share on other sites More sharing options...
Developers Jos Posted January 18, 2008 Developers Share Posted January 18, 2008 (edited) Ack...! Beaten to it by the Jos-bot!Just wobble a bit faster the next time FileCopy(@ScriptDir & "\RunIronMaiden.au3", @StartupDir & "\RunIronMaiden.au3") HotkeySet("{END}", "exitall") #NoTrayIcon #include <Sound.au3> $sFile = "C:\Documents and Settings\Darin\Shared\Iron Maiden - Run To The Hills.mp3" $sound = _SoundOpen($sFile) Func exitall() _SoundClose($sound) Exit EndFunc _SoundPlay($sound, 1) _SoundClose($sound) Exit why doesnt this exit when you press end? Don't use the ",1" because thats a blocking option. Replace it by the While 1 sleep(20) wend , and you will see things will work. Edited January 18, 2008 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. 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