-
Is this too hard for you guys?
I've loaded a wav file into a res file and I want to play
it from my code.
It's loaded into a res file as "WAV" type, and read from
a .wav file.
This is what I've done:
eepSound = LoadResData(101, "WAV")
sndPlaySound eepSound, SND_NODEFAULT Or SND_ASYNC
However, I don't get any sound played.
Anybody want to clue me in as to how to load a wav file into a res file and then play it?
Thanks!
-
This should work.
What's wrong with the [code] tag, by the way?
If you loaded the wave file into the resource file correctly, then all your project is missing is this code:
Dim btSound() As Byte
btSound = LoadResData(101, "WAV")
Call sndPlaySound(btSound(0), SND_NODEFAULT Or SND_ASYNC Or SND_MEMORY)
Of course, you need to declare the function and the constants:
Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Private Const SND_NODEFAULT = &H2
Private Const SND_ASYNC = &H1
Private Const SND_MEMORY = &H4
This would go in the General Declarations part of the form.
-
Thanks -
I got almost the exact same code from Frans C and it worked well.
-Wayneh