VB怎么在单击每个按钮 都播放不同的声音
假如是三个按键,单击commond1就播放D:\02.MP3,单击commond2就播放D:\1。MP3,不要用WindowsMediaPlayer1.URLOption...
假如是三个按键,单击commond1就播放D:\02.MP3,
单击commond2就播放D:\1。MP3,
不要用WindowsMediaPlayer1.URL
Option Explicit
Private 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
Private Sub Form_Load()
Dim mp3path As String
mp3path = App.Path & "\[周艳泓]要嫁就嫁灰太狼-周艳泓.mp3 "
mciSendString "open " & mp3path & " alias mc", 0, 0, 0
mciSendString "play mc", 0, 0, 0
End Sub 展开
单击commond2就播放D:\1。MP3,
不要用WindowsMediaPlayer1.URL
Option Explicit
Private 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
Private Sub Form_Load()
Dim mp3path As String
mp3path = App.Path & "\[周艳泓]要嫁就嫁灰太狼-周艳泓.mp3 "
mciSendString "open " & mp3path & " alias mc", 0, 0, 0
mciSendString "play mc", 0, 0, 0
End Sub 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询