Sign in to follow this  
Followers 0
bobheart

Sound loop ?

5 posts in this topic

Can I make the sound loop with autoit?

Generated with AutoBuilder 0.3

Opt("GUICoordMode", 1)
Opt("GUINotifyMode", 1)

GuiCreate("MyGUI", 392,233,10,10,0x04CF0000)
$button_1 = GUISetControl("button", "fire", 20,20, 80,30)

GuiShow()

While 1
    sleep(100)
    $msg = GuiMsg(0)
    Select
    Case $msg = -3
  Exit
    Case $msg = $button_1
   SoundPlay("E:\Programss\atmospherelite\fire.wav")
    ;;;
    EndSelect
WEnd
Exit

Share this post


Link to post
Share on other sites



I see two methods depending on if you needed the script to continue, or stop. If you need to run other code while your sound repeats, figure out how long the sound you are playing is (either by dividing filesize by bitrate, or just getting the length of the song.) Then, set up an AdLib to play it every X seconds, where X is the length of your song. If you don't need to run other code, just use the optional wait paramater, and put it in a while loop (or for loop if you need it to repeat a specific number of times.)


[font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes.

Share this post


Link to post
Share on other sites

a loop function that does seamless repeats would be good. This I assume just uses the basic windows API to play the sounds? Or is it a directX function?

Having options like loop and play(x) times would work well for GUI's where you may wish to have a small sound that loops (ie music samples, ambient sounds (rain, wind, waterfall) or a sound that is short and can be played a few times. Ie telephone ring, dog bark, etc.

moo

Share this post


Link to post
Share on other sites

a loop function that does seamless repeats would be good. This I assume just uses the basic windows API to play the sounds? Or is it a directX function?

Having options like loop and play(x) times would work well for GUI's where you may wish to have a small sound that loops (ie music samples, ambient sounds (rain, wind, waterfall) or a sound that is short and can be played a few times. Ie telephone ring, dog bark, etc.

moo

That can probably be done with autoitx and an hta

By the way no one still knows how to install autoitx using vbscript?

Rick


Only $2.00 with Resale Rights How to Block Better for Martial Artists and NonMartial Artistshttp://kirkhamsebooks.com/MartialArts/Bloc...tterEbook_m.htm

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