找回密码
 加入
搜索
查看: 1501|回复: 5

帮我修改一下脚本-谢谢

[复制链接]
发表于 2008-5-17 09:25:04 | 显示全部楼层 |阅读模式
请高手帮我改下这处,就是将“打开文件”这处改成一运行脚本就加载“E:\我的音乐\1.mp3”,开始播放音乐。


#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)
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
            _SoundPlay ("alias_suono")
                                                
        Case $nMsg = $Pausa
            _SoundPause ("alias_suono")
      
    EndSelect
WEnd

[ 本帖最后由 botanycc 于 2008-5-18 19:21 编辑 ]
发表于 2008-5-17 20:00:41 | 显示全部楼层
直接在前面塞个
_SoundPlay ("E:\我的音乐\1.mp3")
进去不行么?

好像是不行  暂停失效了

[ 本帖最后由 传说 于 2008-5-17 20:07 编辑 ]
 楼主| 发表于 2008-5-17 20:37:28 | 显示全部楼层
是的啊,继续期待
发表于 2008-5-18 14:53:59 | 显示全部楼层
#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
 楼主| 发表于 2008-5-18 19:20:42 | 显示全部楼层
多谢各位帮忙,问题已经解决了,5楼的最接近我的要求,稍作修改ok了。谢谢...
发表于 2009-7-13 15:53:57 | 显示全部楼层
好東西,不知道有沒有更漂亮點的皮膚
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-5 07:08 , Processed in 0.071387 second(s), 19 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表