Sign in to follow this  
Followers 0
maxthailand

SoundPlay the player does not close

5 posts in this topic

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.

#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

Share this post


Link to post
Share on other sites



maxthailand,

Find yourself a better translator! I have no idea what your problem is from the above post. :D

When I run your script it plays all the files in the inputs - what happens when you try? :oops:

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

maxthailand,

Find yourself a better translator! I have no idea what your problem is from the above post. :D

When I run your script it plays all the files in the inputs - what happens when you try? :oops:

M23

Pause during playback.

Share this post


Link to post
Share on other sites

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

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

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Look at the _Sound* functions (_SoundOpen, _SoundPlay, _SoundPause, etc)

Share this post


Link to post
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
Sign in to follow this  
Followers 0