All pastes #549003 Raw Edit

Stuff

public text v1 · immutable
·published 2007-06-07 22:52 UTC
rendered paste body
Private Declare Function sndPlaySound Lib "winmm" Alias "sndPlaySoundA" (lpszSoundName As Any, ByVal uFlags As Long) As Long
Private Const SND_SYNC = &H0        ' Play synchronously (default).
Private Const SND_NODEFAULT = &H2    ' Do not use default sound.
Private Const SND_MEMORY = &H4
Private Const SND_LOOP = &H8         ' Loop the sound until next
Private Const SND_NOSTOP = &H10      ' Do not stop any currently
Private Const SND_ASYNC = &H1          '  play asynchronously


'call
PlayWave bArr, SND_NODEFAULT Or SND_SYNC Or SND_MEMORY Or SND_ASYNC


'sub
Sub PlayWave(bArr() As Byte, Optional lFlags As Long = SND_NODEFAULT Or SND_SYNC Or SND_MEMORY)
    If (lFlags And SND_MEMORY) = 0 Then lFlags = lFlags Or SND_MEMORY
    sndPlaySound bArr(0), lFlags 
End Sub