How to play more than 1 .wav sounds in C++ at the

2019-06-13 19:28发布

问题:

I am trying to make a game where I need to play many sounds simultaneously I know v.basic or rather just know about the func. PlaySound() to run .wav sounds.

The problem is that with SND_ASYNC I cannot play multiple sound at once but the sound which plays first skips in the middle and plays the next sound.

Is there any way (simple and easy to understand) so that I can play multiple sounds at once?

回答1:

Playsound is not meant for mixing sounds. Essentially, it's an older technology that can easily be outdone by more recent ones.

You can use DirectX for sound development in games (a popular choice).

I personally use FMod since it's really easy to use. Here is a tutorial to get you started.



回答2:

I recommend you to use the latest version of fmod (fmod Studio) that give you posibilities to create diferen channels and play various sounds on each channel and aply effects for each one.