網路城邦
上一篇 回創作列表 下一篇  字體:
SoundPlay By AU3
2013/06/16 10:19:44瀏覽173|回應0|推薦0


#include <Sound.au3>

Local $aSound = _SoundOpen("C://HTSMini/Anna.wma")
If @error = 2 Then
    MsgBox(0, "Error", "The file does not exist")
    Exit
ElseIf @extended <> 0 Then
    Local $iExtended = @extended ; Assign because @extended will be set after DllCall.
    Local $tText = DllStructCreate("char[128]")
    DllCall("winmm.dll", "short", "mciGetErrorStringA", "str", $iExtended, "ptr", DllStructGetPtr($tText), "int", 128)
    MsgBox(0, "Error", "The open failed." & @CRLF & "Error Number: " & $iExtended & @CRLF & "Error Description: " & DllStructGetData($tText, 1) & @CRLF & "Please Note: The sound may still play correctly.")
Else
    MsgBox(0, "Success", "The file opened successfully")
EndIf

_SoundPlay($aSound, 1)

_SoundClose($aSound)

( 興趣嗜好電腦3C )
回應 列印 加入我的文摘
上一篇 回創作列表 下一篇

引用
引用網址:https://classic-blog.udn.com/article/trackback.jsp?uid=ezkang3245&aid=7766068