- 积分
- 73549
- 明经币
- 个
- 注册时间
- 2001-6-7
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
- '播放器调用
- Declare Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
- Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
- Public Const SND_SYNC = &H0
- Public Const SND_ASYNC = &H1
- Public Const SND_LOOP = &H8' 播放MID文件
- Public Sub PlayMID(strFileName As String)
- Dim lngRet As Long
- lngRet = mciSendString("open " & strFileName & " type sequencer alias canyon", 0&, 0, 0)
- lngRet = mciSendString("play canyon wait", 0&, 0, 0)
- lngRet = mciSendString("close canyon", 0&, 0, 0)
- End Sub' 播放WAV文件
- Public Sub PlayWav(strFileName As String , ChkRepeat As Boolean)
- Dim intRetval As Integer
- intRetval = sndPlaySound(ByVal strFileName, IIf(chkRepeat, SND_ASYNC Or SND_LOOP, SND_ASYNC))
- 'If intRetval = 0 Then MsgBox ("Error!")
- End Sub
|
|