sound

Xtreme
04-02-2001, 01:23 PM
i am using direct x 7.
i am programming a game similar to bomberman.
however the way in which i am playing the sound effects (.wav) it cuts off or doesnt sound if another one is playing. I thought that direct x could do more that one .wav at once? Does anyone have some code that would play multiple .wavs at once if called?

my code looks like this:

Private Function Play_Sound(track)


If track = "explode" Then
track = ""

DBuffer(0).Play DSBPLAY_DEFAULT

End If

If track = "destroy" Then
track = ""
DBuffer(1).Play DSBPLAY_DEFAULT

End If

end sub

this code executes when a sound event is supossed to happen i call the sub with the appropriate track. however i cannot hear both sounds at once!

thanks

anhmytran
04-03-2001, 08:39 AM
I do not look at your code, for I use only common sense.
There are 2 senarios: 1- Two sets of signal comming to the loud speaker
and 2- only one set of signal comming to the loud speaker.
In your case, it is only one set of analog signal comming to the loud speaker.
In case there are more than one set of analog signal comming to the loud speaker
the loud speaker will play the SUM of all sets of analog signal, and the sound
is unlikely musics or voice at all. Remember that the loud speaker cannot
play digital signal, for digital is super high frequency.
You are lucky that you can hear the WAV from your system.
In order to mix many sets of sound signals, we need a new software.

AnhMy_Tran

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum