سؤال

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?

هل كانت مفيدة؟

المحلول

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top