Jump to content

Repeatedly sound at GUI


marsL
 Share

Recommended Posts

Hello, can you help me to creat a download tool for Avira with continuous playing of sound in following script

#include <GUIConstants.au3>

_Main()
Func _Main()
; Window
    GUICreate("Window title",256,278,-1,-1,-1,1)
; BackGround
    GUISetBkColor(0xDE0007)
; Sound
    SoundPlay("Dogma.mp3",0)
; Buttons
    $Btn01=GuiCtrlCreateButton("Homepage of Avira",10,10,236,24)
    GUICtrlSetFont(-1,9,700,0)
    $Btn02=GuiCtrlCreateButton("Updates",10,58,236,24)
    GUICtrlSetFont(-1,9,700,0)
    $Btn03=GuiCtrlCreateButton("Downloads",10,106,236,24)
    GUICtrlSetFont(-1,9,700,0)
    GUISetState()
; While
    While 1
    Switch GUIGetMsg()
    Case $GUI_EVENT_CLOSE
    ExitLoop
    Case $Btn01
    ShellExecute("http://www.avira.com/en/for-home")
    Case $Btn02
    ShellExecute("http://www.avira.com/en/support-vdf-update-info")
    Case $Btn03
    ShellExecute("http://www.avira.com/en/support-download")

    EndSwitch
    WEnd
GUIDelete()
; Close
    Exit
; End function
EndFunc

I just want a like as a keygen - with any sound :)

Link to comment
Share on other sites

If it's just an mp3 you could use the native Sound UDF, see "Sound Management" in the helpfile.

You basically do:

_SoundOpen()

_SoundPlay()

While 1

If _SoundStatus() = paused then _SoundPlay()

Wend

_SoundClose()

No need for extra dll's unless you want to.

Link to comment
Share on other sites

If it's just an mp3 you could use the native Sound UDF, see "Sound Management" in the helpfile.

You basically do:

_SoundOpen()

_SoundPlay()

While 1

If _SoundStatus() = paused then _SoundPlay()

Wend

_SoundClose()

No need for extra dll's unless you want to.

@OP, the above method has the unmentioned drawback of short gaps between stopping and starting the mp3. BASS library can do it without gaps. I didn't mentioned the _Sound UDf method because it is noob. Edited by Manadar
Link to comment
Share on other sites

I wasn't saying that either of the methods are perfect. The cost of disk space when you use extra files is obvious, the annoying gap when you're trying to loop a sound does not become apparent until you have tried it. To save the OP a failed attempt, I pointed out what does not become immediately obvious.

Such is the nature of providing assistance on these forums. You think ahead as far as possible and consider any decisions they are forced to take in the future. Sometimes the right decision is obvious, sometimes it needs to be explained.

Edited by Manadar
Link to comment
Share on other sites

Tracker music would be great too, with the dll included in the script.

Mods can loop, a mp3 file would have to be custom tailored for that, and it will still probably sound weird.

It would also sound more like the "demo/keygen" sound.

trancexx made an example of that <-- link

Edit:changed wording

Edited by AdmiralAlkex
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...