Playing mutiple files simultaneously with the PlaySound() API

空扰寡人 提交于 2019-12-12 17:26:14

问题


I've recently discovered how easy it is to play a wav file using the Win32 API PlaySound() function.

I'm currently implementing it in my game for my background music. I also plan to use it every time my score increases by one. Unfortunately when I do this, and it plays the score sound, then it stops the background music.

Is there a way to have both wav files play simultaneously?


回答1:


You can use the SND_NOSTOP flag to achieve this. But you are probably better off using a DirectX technology for sound if you're writing a game.



来源:https://stackoverflow.com/questions/16073675/playing-mutiple-files-simultaneously-with-the-playsound-api

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