如何使用PlaySound()或任何基本功能/方法同时在C ++中播放超过1 .wav声音?

时间:2021-12-23 19:43:47

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.

我正在尝试制作一个游戏,我需要同时播放许多声音我知道v.basic或者更确切地说只是了解func。 PlaySound()运行.wav声音。

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.

问题是,对于SND_ASYNC,我不能同时播放多个声音,但首先播放的声音会在中间跳过并播放下一个声音。

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

有没有办法(简单易懂),这样我可以一次播放多个声音?

2 个解决方案

#1


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

Playsound不适合混合声音。从本质上讲,它是一种较旧的技术,很容易被更新的技术所超越。

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

您可以使用DirectX在游戏中进行声音开发(一种流行的选择)。

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

我个人使用FMod,因为它非常容易使用。这是一个帮助您入门的教程。

#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.

我建议你使用最新版本的fmod(fmod Studio),它可以创建不同的频道,并在每个频道播放各种声音,并为每个频道播放各种效果。

#1


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

Playsound不适合混合声音。从本质上讲,它是一种较旧的技术,很容易被更新的技术所超越。

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

您可以使用DirectX在游戏中进行声音开发(一种流行的选择)。

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

我个人使用FMod,因为它非常容易使用。这是一个帮助您入门的教程。

#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.

我建议你使用最新版本的fmod(fmod Studio),它可以创建不同的频道,并在每个频道播放各种声音,并为每个频道播放各种效果。