maxthailand Posted November 5, 2011 Share Posted November 5, 2011 Once the files have a problem with the SoundPlay play. The program will not be able to hold off or get on or off can make you or not. expandcollapse popup#include <GUIConstants.au3> $Form1_1 = GUICreate("โปรแกรมเล่นเพลง V2", 400, 459, 464, 99) $Label1 = GUICtrlCreateLabel("เพลงที่ 1", 16, 8, 43, 17) $Input1 = GUICtrlCreateInput("", 16, 24, 305, 21) $Button1 = GUICtrlCreateButton("Browser", 328, 24, 57, 25, 0) $Label2 = GUICtrlCreateLabel("เพลงที่ 2", 16, 56, 44, 17) $Input2 = GUICtrlCreateInput("", 16, 72, 305, 21) $Button2 = GUICtrlCreateButton("Browser", 328, 72, 57, 25, 0) $Label3 = GUICtrlCreateLabel("เพลงที่ 3", 16, 104, 44, 17) $Input3 = GUICtrlCreateInput("", 16, 120, 305, 21) $Button3 = GUICtrlCreateButton("Browser", 328, 120, 57, 25, 0) $Label4 = GUICtrlCreateLabel("เพลงที่ 4", 16, 152, 44, 17) $Input4 = GUICtrlCreateInput("", 16, 168, 305, 21) $Button4 = GUICtrlCreateButton("Browser", 328, 168, 57, 25, 0) $Label5 = GUICtrlCreateLabel("เพลงที่ 5", 16, 200, 44, 17) $Input5 = GUICtrlCreateInput("", 16, 216, 305, 21) $Button5 = GUICtrlCreateButton("Browser", 328, 216, 57, 25, 0) $Label6 = GUICtrlCreateLabel("เพลงที่ 6", 16, 248, 44, 17) $Input6 = GUICtrlCreateInput("", 16, 264, 305, 21) $Button6 = GUICtrlCreateButton("Browser", 328, 264, 57, 25, 0) $Label7 = GUICtrlCreateLabel("เพลงที่ 7", 16, 296, 44, 17) $Input7 = GUICtrlCreateInput("", 16, 312, 305, 21) $Button7 = GUICtrlCreateButton("Browser", 328, 312, 57, 25, 0) $Label8 = GUICtrlCreateLabel("เพลงที่ 8", 16, 344, 44, 17) $Input8 = GUICtrlCreateInput("", 16, 360, 305, 21) $Button8 = GUICtrlCreateButton("Browser", 328, 360, 57, 25, 0) $Slider1 = GUICtrlCreateSlider(16, 400, 369, 25) $Label9 = GUICtrlCreateLabel("ปรับระดับเสียง", 16, 384, 72, 17) $Label10 = GUICtrlCreateLabel("0", 88, 384, 20, 20) $Play = GUICtrlCreateButton("เล่นเพลง", 16, 424, 369, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $var1 = FileOpenDialog("กรุณาเลือกไฟล์เพลง","\", "MPEG Audio (*.mp3)", 1 + 4 ) $var1 = StringReplace($var1, "|", @CRLF) GUICtrlSetData($Input1,$var1) Case $Button2 $var2 = FileOpenDialog("กรุณาเลือกไฟล์เพลง","\", "MPEG Audio (*.mp3)", 1 + 4 ) $var2 = StringReplace($var2, "|", @CRLF) GUICtrlSetData($Input2,$var2) Case $Button3 $var3 = FileOpenDialog("กรุณาเลือกไฟล์เพลง","\", "MPEG Audio (*.mp3)", 1 + 4 ) $var3 = StringReplace($var3, "|", @CRLF) GUICtrlSetData($Input3,$var3) Case $Button4 $var4 = FileOpenDialog("กรุณาเลือกไฟล์เพลง","\", "MPEG Audio (*.mp3)", 1 + 4 ) $var4 = StringReplace($var4, "|", @CRLF) GUICtrlSetData($Input4,$var4) Case $Button5 $var5 = FileOpenDialog("กรุณาเลือกไฟล์เพลง","\", "MPEG Audio (*.mp3)", 1 + 4 ) $var5 = StringReplace($var5, "|", @CRLF) GUICtrlSetData($Input5,$var5) Case $Button6 $var6 = FileOpenDialog("กรุณาเลือกไฟล์เพลง","\", "MPEG Audio (*.mp3)", 1 + 4 ) $var6 = StringReplace($var6, "|", @CRLF) GUICtrlSetData($Input6,$var6) Case $Button7 $var7 = FileOpenDialog("กรุณาเลือกไฟล์เพลง","\", "MPEG Audio (*.mp3)", 1 + 4 ) $var7 = StringReplace($var7, "|", @CRLF) GUICtrlSetData($Input7,$var7) Case $Button8 $var8 = FileOpenDialog("กรุณาเลือกไฟล์เพลง","\", "MPEG Audio (*.mp3)", 1 + 4 ) $var8 = StringReplace($var8, "|", @CRLF) GUICtrlSetData($Input8,$var8) Case $Slider1 GUICtrlSetData($Label10,GUICtrlRead($Slider1)) Case $Play SoundSetWaveVolume(GUICtrlRead($Slider1)) MsgBox(0,"","เพลงที่ 1 กำลังจะเล่น",2) SoundPlay(GUICtrlRead($Input1),1) MsgBox(0,"","เพลงที่ 2 กำลังจะเล่น",2) SoundPlay(GUICtrlRead($Input2),1) MsgBox(0,"","เพลงที่ 3 กำลังจะเล่น",2) SoundPlay(GUICtrlRead($Input3),1) MsgBox(0,"","เพลงที่ 4 กำลังจะเล่น",2) SoundPlay(GUICtrlRead($Input4),1) MsgBox(0,"","เพลงที่ 5 กำลังจะเล่น",2) SoundPlay(GUICtrlRead($Input5),1) MsgBox(0,"","เพลงที่ 6 กำลังจะเล่น",2) SoundPlay(GUICtrlRead($Input6),1) MsgBox(0,"","เพลงที่ 7 กำลังจะเล่น",2) SoundPlay(GUICtrlRead($Input7),1) MsgBox(0,"","เพลงที่ 8 กำลังจะเล่น",2) SoundPlay(GUICtrlRead($Input8),1) MsgBox(0,"","จบการเล่นเพลง",2) EndSwitch WEnd Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 5, 2011 Moderators Share Posted November 5, 2011 maxthailand, Find yourself a better translator! I have no idea what your problem is from the above post. When I run your script it plays all the files in the inputs - what happens when you try? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
maxthailand Posted November 5, 2011 Author Share Posted November 5, 2011 maxthailand, Find yourself a better translator! I have no idea what your problem is from the above post. When I run your script it plays all the files in the inputs - what happens when you try? M23Pause during playback. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 5, 2011 Moderators Share Posted November 5, 2011 maxthailand, As I stated I got the script to run with no problems - but I was not doing much else on the machine at the time. You could try increasing the priority level: ; Set process priority to Above Normal ProcessSetPriority (@ScriptName, 3) Although that will only work if you compile the script. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Ascend4nt Posted November 5, 2011 Share Posted November 5, 2011 Look at the _Sound* functions (_SoundOpen, _SoundPlay, _SoundPause, etc) My contributions: Performance Counters in Windows - Measure CPU, Disk, Network etc Performance | Network Interface Info, Statistics, and Traffic | CPU Multi-Processor Usage w/o Performance Counters | Disk and Device Read/Write Statistics | Atom Table Functions | Process, Thread, & DLL Functions UDFs | Process CPU Usage Trackers | PE File Overlay Extraction | A3X Script Extract | File + Process Imports/Exports Information | Windows Desktop Dimmer Shade | Spotlight + Focus GUI - Highlight and Dim for Eyestrain Relief | CrossHairs (FullScreen) | Rubber-Band Boxes using GUI's (_GUIBox) | GUI Fun! | IE Embedded Control Versioning (use IE9+ and HTML5 in a GUI) | Magnifier (Vista+) Functions UDF | _DLLStructDisplay (Debug!) | _EnumChildWindows (controls etc) | _FileFindEx | _ClipGetHTML | _ClipPutHTML + ClipPutHyperlink | _FileGetShortcutEx | _FilePropertiesDialog | I/O Port Functions | File(s) Drag & Drop | _RunWithReducedPrivileges | _ShellExecuteWithReducedPrivileges | _WinAPI_GetSystemInfo | dotNETGetVersions | Drive(s) Power Status | _WinGetDesktopHandle | _StringParseParameters | Screensaver, Sleep, Desktop Lock Disable | Full-Screen Crash Recovery Wrappers/Modifications of others' contributions: _DOSWildcardsToPCRegEx (original code: RobSaunder's) | WinGetAltTabWinList (original: Authenticity) UDF's added support/programming to: _ExplorerWinGetSelectedItems | MIDIEx UDF (original code: eynstyne) (All personal code/wrappers centrally located at Ascend4nt's AutoIT Code) Link to comment Share on other sites More sharing options...
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