与PlaySound()API同时播放多个文件 [英] Playing mutiple files simultaneously with the PlaySound() API
问题描述
我最近发现使用Win32 API播放 wav
文件有多么容易 PlaySound()
函数。
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...
有没有让 wav
文件同时播放?
Is there away to have both wav
files play simultaneously?
推荐答案
您可以使用 SND_NOSTOP
标志来达到此目的。
但是如果你正在编写一个游戏,你可能最好使用DirectX技术声音。
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.
这篇关于与PlaySound()API同时播放多个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!