Playing multiple sounds simultaneously

Hello again,
I'm using Visual C++ 6.0 on an intel pentium II class machine under  Windows NT 4.0 sp5. I've written a program that plays a sound when it's cooresponding key is pressed...all's fine except I'm using "PlaySound" and it stops playing one sound when another sound is initialized.
I would like to at least have two layers of sound (I mean, to be able to play at least two different sounds at once). Is there a library already in Visual C++ for this? Or perhaps could someone alude to a method of implementing such a task. My sound card is a sound blaster awe64.
Thank you.
crash020297Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

NickRepinCommented:
Option A. Buy good sound card like Diamond Monster II which allows to re-use output wave device.

Option B. You have to mix all sound data yourself and play it using waveOutOpen() etc. Much more work than just PlaySound().

Option C. You mix sounds using wave editor program and then play them as one wave file using PlaySound(). Most easy solution.
0
NickRepinCommented:
Option D. Use DirectX sound.
0
simonetCommented:
Crash, there's this library, MidasFX, that allows you to play up to 8 simultaneous voices on most sound cards. Besides, it also allows you to apply some special effects to the files and is really easy to use.

The library is freeware, comes with C/C++/Delphi/VB headers and can be downloaded from:

http://www.s2.org/midas/

Enjoy!

Yours,

Alex
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
crash020297Author Commented:
Thank you for your help one more little add in though:

Everything compiles fine with this library but it won't seem to play the sounds (samples in wav format). I understand there could be a million possibilities why this is so but all I would like to know is whether or not you know what excactly the format of the wav needs to be in order for playback. It's likely that mine are just an incorrect format. I'll look around for that info too, so don't worry if you don't know off the top of your head. And thank you again.

Chip Collier
0
simonetCommented:
I use mostly Delphi. I have mixed the following formats using MidasFX:

Stereo, 22.1 Khz, short files
+
2 files Mono, 44.1 Khz, long files (background sounds)

It worked fine. Unfortunatly I don't have the source, since it was a program done for a former employer.

I suggest you check to see if the files were created using a CODEC that you have on your machine. Many times sounds not being played-back are related to missing CODECs.

Yours,

Alex
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.