Jump to content

Recommended Posts

Posted
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <Sound.au3>
#include <ButtonConstants.au3>
$Form1 = GUICreate("Form1", 249, 161, 192, 124)
$Radio1 = GUICtrlCreateRadio("Sounds Spektrum", 40, 24, 113, 17)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $Radio1
     global $sound = _SoundOpen("Spektrum.mp3")
            $IDSound=_SoundPlay($sound,1)

        Case $GUI_EVENT_CLOSE
        _SoundClose($sound)
        Exit
        ;Case

    EndSwitch
WEnd

Hi Guys this is my simple script and im trying to work on like i want to play simple music while script is running is that possible cause i test it its running sounds its working but then after Soundplay start GUI get not responding and also i cant close in normally i need to force quit or close is there any idea how can i  deal with this ? thankyou in advance guys sorry i dont know how autoit can play music 

  • Developers
Posted
10 minutes ago, Bishop12 said:

but then after Soundplay start GUI get not responding

Makes sense when you tell AutoIt3 to wait till it is finished ...right? 
Check the helpfile for _SoundPlay(). ;) 

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.
  :)

Posted
6 minutes ago, Jos said:

Makes sense when you tell AutoIt3 to wait till it is finished ...right? 
Check the helpfile for _SoundPlay(). ;) 

Jos

yes @jos i just test it and Soundplay is for easy to use but ill try to check Soundplay again thankyou for responding hehe

Posted
On 11/29/2019 at 2:59 AM, JuanFelipe said:

I have a list of five songs on a route, I randomly sound a different one every time I open the program, do you have the song on the same script path?

Here I leave the example of my function.

Func _escogercancion()
      Local $random = Number(Random(1,5,1))
      Local $ruta = @CRLF&@ScriptDir&"\Plug-in\"&$random&".mp3"
      SoundPlay($ruta)
      ConsoleWrite($ruta)
   EndFunc

 

Yes sir  ill Try this also later thankyou so much hehe

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
  • Recently Browsing   0 members

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