网学之家(5588net.com) - 执着关注互联网技术!

网学之家|5588net.com

当前位置: 主页 > 程序开发 > VB > 编程技巧 >

用API函数Mcisendstring直接播放背景音乐

来源:www.5588net.com 作者:网学之家 时间:2014-04-08 点击:
源代码:
Private Sub Command1_Click()
Dim back
back = mciSendString&("CLOSE NN", 0, 0, 0)
End Sub

Private Sub Command2_Click()
Dim back
back = mciSendString&("OPEN " + App.Path + "\TEST.mid" + " TYPE SEQUENCER ALIAS NN", 0&, 0, 0)
back = mciSendString&("PLAY NN FROM 0", 0&, 0, 0)
R% = mciSendString&("CLOSE ANIMATION", 0&, 0, 0)
End Sub

Private Sub Form_Load()
Dim back
back = mciSendString&("OPEN " + App.Path + "\TEST.mid" + " TYPE WaveAudio ALIAS NN", 0&, 0, 0)
back = mciSendString&("PLAY NN FROM 0", 0&, 0, 0)
R% = mciSendString&("CLOSE ANIMATION", 0&, 0, 0)
End Sub

 

顶一下
(0)
0%
踩一下
(0)
0%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价:
验证码: 点击我更换图片