Jump to content
Sign in to follow this  
buzz44

SoundPlay ( "filename" [, wait] )

Recommended Posts

buzz44

SoundPlay ("C:\blah\blah.mid")
   $LTJB = MsgBox (4, "Blah", "Blah" )
   If $LTJB = 7 Then
      Exit
   EndIf

;Script then continoues

The above scripts plays a sound file and pops a msg box up, if u Click No or close the msgbox the sound will stop playing because autoit3 isnt running anymore, but if u click yes the sound will continue to play

Is there a way i can stop the sound without closing the msg box or clicking "no"? i want it to be able to stop when "yes" is pressed

Edited by burrup

qq

Share this post


Link to post
Share on other sites
Somerset

the only way to stop a file from playing is terminating the script. are you wanting to carry on with the script while the sound is going? or just stop the sound to start another?


 

Spoiler

 

Share this post


Link to post
Share on other sites
buzz44

If "yes" OR "no" is clicked it will stop the sound

clicking no closes the script

clicking yes continues the script


qq

Share this post


Link to post
Share on other sites
Somerset

SoundPlay ("entertanr.mid")
   $LTJB = MsgBox (4, "Blah", "Blah" )
   If $LTJB = 7 Then
SoundPlay ("null")
   EndIf
sleep(10000)
;Script then continoues

instead of exit i just executed soundplay again on a file that doesn't exist. it stops the sound right now. then i added the delay to see if it truly ended and yeah it did.


 

Spoiler

 

Share this post


Link to post
Share on other sites
buzz44

ahhh very good... ty. I think they should include that in the help file :)


qq

Share this post


Link to post
Share on other sites
Wb-FreeKill

ahhh very good... ty. I think they should include that in the help file :)

<{POST_SNAPBACK}>

Ahh nice, i needed it too... yeah somethings missing in the helpfile about this func..

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×