用API函数Mcisendstring直接播放背景音乐
【打印文章】
作者:徐建波
源代码:
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
源代码:
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
本栏文章均来自于互联网,版权归原作者和各发布网站所有,本站收集这些文章仅供学习参考之用。任何人都不能将这些文章用于商业或者其他目的。( Pfan.cn )
【编程爱好者论坛】