PDA

Click to See Complete Forum and Search --> : two sounds at a time (real audio and wav)


spandex44
Jan 25th, 2000, 12:31 AM
Hi!
I've asked this question before, but got no reponse:
Is there a way to play a real audio file (using the real audio activex control), while at the same time playing (and hearing) a WAV file. This is the code I used to play the WAV file:

Declarations:

Private Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" _
(ByVal lpszSoundName As String, ByVal uFlags As Long) As Long
Const SND_SYNC = &H0
Const SND_ASYNC = &H1
Const SND_NODEFAULT = &H2
Const SND_LOOP = &H8
Const SND_NOSTOP = &H10

Code:

SoundFile$ = "c:\windows\example.wav"
wFlags% = SND_ASYNC Or SND_NODEFAULT
x% = sndPlaySound(SoundFile$, wFlags%)

Please help! Thanks.


------------------
Regards,
Alexander McAndrew
VB Zone
http://vbzone.cjb.net (http://gsenterprise.server101.com)

chrisjk
Jan 25th, 2000, 12:38 AM
I think the only condition is if your sound hardware supports it. I have a SB AWE 64 which will only play 1 file at a time...I also have a Turtle Beach Montego II that plays as many as 64 files at a time.

RealAudio uses the WAV output of your sound card, so if your hardware don't support multiple waves, it won't work!

hope that helps,

------------------
- Chris
chris.kilhams@btinternet.com
If it ain't broke - don't fix it :)

spandex44
Jan 25th, 2000, 03:13 AM
Thanks for the reply.
Question: If what you told me is true, then how can major game publishers take care of that problem? I'm sure that they don't hope that the user's card supports multiple files at a time.
Thanks.

------------------
Regards,
Alexander McAndrew
VB Zone
http://vbzone.cjb.net (http://gsenterprise.server101.com)

Troy Mac
Jan 25th, 2000, 03:47 AM
chrisjk Check again your Awe64 is a duplex sound card an will play more than one audio file at a time. I do MIDI and Audio recording and listen to more then 1 audio track at a time with my Awe 64.

------------------
TMacPherson
Customer Suport Software Analyst
t_macpherson@yahoo.com

chrisjk
Jan 25th, 2000, 06:15 AM
Andrew - Games publishers take care of this by using DirectX...it allows you to overlay sounds, producing only 1 sound for crap hardware (not being rude or anything). You'll have to integrate DirectX into your app (don't ask me how...i have no idea :))
Before DirectX existed, they developed their own method of overlaying sounds.

Troy - Sorry, I meant my REALLY old computer (P120 sitting in the corner feeling sorry for itself). It has a SB16 that only plays 1 WAV at a time

Regards,

------------------
- Chris
chris.kilhams@btinternet.com
If it ain't broke - don't fix it :)


[This message has been edited by chrisjk (edited 01-25-2000).]