-
Help sound resource file
This is a exe with a sou d file stored ina resoucre it crashes on my computer for some reason
Please HElp
Code:
Option Explicit
Private Declare Function sndPlaySound Lib "winmm.dll" _
Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, _
ByVal uFlags As Long) As Long
Private Const SND_ASYNC = &H1 ' play asynchronously
Private Const SND_MEMORY = &H4 ' lpszSoundName points to a memory file
Private Const SND_NODEFAULT = &H2 ' silence not default, if sound not found
Private Sub PlayIt(WavID As Variant)
Dim SoundBuffer As String
SoundBuffer = StrConv(LoadResData(WavID, "WAVE"), vbUnicode)
sndPlaySound SoundBuffer, SND_ASYNC Or SND_NODEFAULT Or SND_MEMORY
End Sub
Private Sub Command1_Click()
PlayIt "CHIMES"
End Sub
Private Sub Command2_Click()
PlayIt "CHORD"
End Sub
Private Sub Command3_Click()
PlayIt "DING"
End Sub
-
You have to stop the sound that is playing before playing another.
-
whast the command
is this it PlaySound vbNullString, 0, 0