Public Declare Function sndPlaySound& Lib "winmm.dll" Alias"sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long)

Global Const SND_SYNC = &H0

Global Const SND_ASYNC = &H1

Global Const SND_NODEFAULT = &H2

Global Const SND_LOOP = &H8

Global Const SND_NOSTOP = &H10

 

 

Sub PlayWav(SoundName As String)

Dim tmpSoundName As String

Dim wFlags%, X%

tmpSoundName = pathWavFiles & SoundName

wFlags% = SND_ASYNC Or SND_NODEFAULT

X% = sndPlaySound(tmpSoundName, wFlags%)

End Sub