#include <Sound.au3>
#include <GUIConstantsEx.au3>
#Region ### START Koda GUI section ###
$Form1_1 = GUICreate("例", 350, 258, -1, -1)
GUISetBkColor(0xccccc)
$Sfoglia = GUICtrlCreateButton("打开文件", 130, 30, 81, 21)
$Pausa = GUICtrlCreateButton("暂 停", 48, 104, 121, 33)
GUICtrlSetFont(-1, 14, 400, 0, "黑体")
$Play = GUICtrlCreateButton("播 放", 192, 104, 113, 33)
GUICtrlSetFont(-1, 14, 400, 0, "黑体")
$Slider = GUICtrlCreateSlider(40, 200, 265, 33)
$Volume = GUICtrlCreateLabel("音 量", 152, 176, 50, 20)
GUICtrlSetColor(-1, 0xFF0000)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
$Percorso = 0
GUICtrlSetData($Slider, 80)
$sound = _SoundOpen("E:\我的音乐\1.mp3", "alias_suono")
_SoundPlay($sound)
While 1
$nMsg = GUIGetMsg()
$Slider_volume = GUICtrlRead($Slider)
SoundSetWaveVolume($Slider_volume)
Select
Case $nMsg = $GUI_EVENT_CLOSE
Exit
Case $nMsg = $Sfoglia
$Percorso = (FileOpenDialog("选择:", @ScriptDir, "(*.mp3;*.wav;*.wma)"))
_SoundClose("alias_suono")
_SoundOpen($Percorso, "alias_suono")
Case $nMsg = $Play
$sound = _SoundOpen("E:\我的音乐\1.mp3", "alias_suono")
_SoundPlay($sound)
Case $nMsg = $Pausa
_SoundPause("alias_suono")
EndSelect
WEnd |