VB.net 播放 WAV音乐

前端之家收集整理的这篇文章主要介绍了VB.net 播放 WAV音乐前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

Public Declare Function PlaySound Lib "winmm.dll" (ByVal lpszSoundName As String,ByVal hModule As Integer,ByVal dwFlags As Integer) As Integer

Const SND_FILENAME As Integer = &H20000 ' 文件模式
Const SND_ALIAS As Integer = &H10000 '自己查查
Const SND_SYNC As Integer = &H0 '同步
Const SND_ASYNC As Integer = &H1 '异步
Const SND_LOOP As Integer = &H8 '循环


‘播放音乐

Private Sub Button1_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles Button1.Click Dim nologin As String = "LoopyMusic.wav" PlaySound(nologin,SND_LOOP Or SND_ASYNC) End Sub ‘停止播放音乐 Private Sub Button2_Click(ByVal sender As System.Object,ByVal e As System.EventArgs) Handles Button2.Click PlaySound(vbNullString,0) End Sub

猜你在找的VB相关文章