How to play more than 1 .wav sounds in C++ at the same time using PlaySound() or any basic function/method?

霸气de小男生 提交于 2019-12-08 05:48:44

问题


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.



来源:https://stackoverflow.com/questions/30144635/how-to-play-more-than-1-wav-sounds-in-c-at-the-same-time-using-playsound-or

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!