Nigel 0 Posted August 17, 2010 #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Building Something Out of Nothing", 654, 566, 302, 218) $n1 = GUICtrlCreateList("", 64, 170, 521, 385) GUICtrlSetData(-1, "Grey Ice Water|Interstate 8|", "") $n2 = GUICtrlCreateButton("Play", 10, 110, 50) GUICtrlSetState(-1, $GUI_FOCUS) ; the focus is on this button GUISetState() GUICtrlCreateTabItem("") $Pic1 = GUICtrlCreatePic(@ScriptDir & "\BNOS.jpg", 200, 24, 233, 145, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() If $nMsg = $n2 Then If GUICtrlRead($n1) = "Grey Ice Water" Then SoundPlay(@ScriptDir & "\Album\Modest Mouse- Grey Ice Water.mp3",1) & If GUICtrlRead($n1) = "Interstate 8" Then SoundPlay(@ScriptDir & "\Album\Modest Mouse - Interstate 8.mp3", 1) EndIf Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Right now, the songs will play perfectly, but after you click the play button, the entire program freezes, and you can't click on anything else. Does anyone have a solution to unfreeze the program and perhaps add in a pause button for the song? Thanks, Nigel Share this post Link to post Share on other sites
AdmiralAlkex 125 Posted August 17, 2010 Are you serious? You specifically wrote your script to wait until playback is done! SoundPlay -------------------------------------------------------------------------------- Play a sound file. SoundPlay ( "filename" [, wait] ) wait [optional] This flag determines if the script should wait for the sound to finish before continuing: 1 = wait until sound has finished 0 = continue script while sound is playing (default) As for pausing etc, look at _PlaySound() and it's relatives under "Sound Management" in the helpfile. .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Share this post Link to post Share on other sites