|
-
Aug 16th, 2006, 09:30 PM
#1
Thread Starter
New Member
Playing 2 wav file at a same time. HELP!
I am now doing a project of a mini car game. during game play the background music will be playing.. when the car hit something it will play another sound but it play the hit sound and the background music stop. please help mi slove this... i have use multithread before still won't work.. below is the code i use to play wav file
Declare Auto Function sndPlaySound Lib "WINMM.DLL" (ByVal FileName As String, ByVal Options As Int32) As Int32
Const SND_SYNC = &H0 'synchronize playback - 'locks' app until sound finished
Const SND_ASYNC = &H1 ' played async - app continues while sound playing
Const SND_ASYNC2 = &H1 ' played async - app continues while sound playing
Const SND_NODEFAULT = &H2 ' No default sound played if file not found
Const SND_LOOP = &H8 ' 'loop the wave
Const SND_NOSTOP = &H10 'don't stop current sound if one playing
Const SND_NOWAIT = &H2000 'Do not wait if the sound driver is busy.
Const SND_ALIAS = &H10000 ' Play a Windows sound (such as SystemStart, Asterisk, etc.).
'Select Game Play Music
Public Sub SelectGP()
GP = Int(Rnd() * 8)
GP = "GP" + GP + ".wav"
sndPlaySound(GP.ToString, SND_ASYNC2 Or SND_LOOP)
End Sub
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
|