|
-
Jun 2nd, 2000, 01:09 AM
#1
Thread Starter
Hyperactive Member
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!
-
Jun 2nd, 2000, 05:11 AM
#2
Guru
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.
-
Jun 2nd, 2000, 06:02 AM
#3
Thread Starter
Hyperactive Member
Thanks -
I got almost the exact same code from Frans C and it worked well.
-Wayneh
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|