Private Const SND_SYNC = &H0
Private Const SND_MEMORY = &H4
'API函数
Private Declare Function sndPlaySoundFromMemory Lib "winmm.dll" Alias "sndPlaySoundA" (lpszSoundName As Any, ByVal uFlags As Long) As Long
'音乐效果请“单击”
Private Sub Form_Click()
Dim myMusic() As Byte
'Res 文件读取时也不区分大小写
myMusic = LoadResData("Sound", "Wave")
sndPlaySoundFromMemory myMusic(0), SND_MEMORY Or SND_SYNC
End Sub
把 wav音乐文件存放到VB的资源里面,然后就可以调用了。注意以上资源的命名 "Sound", "Wave"