Bishop12 Posted November 28, 2019 Posted November 28, 2019 #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 Jos Posted November 28, 2019 Developers Posted November 28, 2019 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.
Bishop12 Posted November 28, 2019 Author Posted November 28, 2019 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
JuanFelipe Posted November 28, 2019 Posted November 28, 2019 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
Bishop12 Posted November 30, 2019 Author Posted November 30, 2019 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now