Sign in to follow this  
Followers 0
buzz44

SoundPlay ( "filename" [, wait] )

6 posts in this topic

#1 ·  Posted (edited)

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

[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

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

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

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

clicking no closes the script

clicking yes continues the script


[u]Old Projects:[/u]A3MORGB2Hex[u]Old Functions:[/u]_TimeAdd/_TimeSub_AddComma_BubbleSort _RippleSort "He who does not understand your silence will probably not understand your words." - Elbert Hubbard.

Share this post


Link to post
Share on other sites

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

shoot_zpsfd329d66.png
dontbelieveeverythingyouthink_zps0e1e900

Madness is the first step to understanding...

Share this post


Link to post
Share on other sites

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  
Followers 0