0
PlaySound("./backgrounMusic.wav", NULL, SND_ASYNC ) //this is my main music for my game
PlaySound("./buttonEffect.wav", NULL, SND_FILENAME | SND_ASYNC); 

I am developing a videogame using C++ and OpenGL and Visual Studio 2015, I am trying to play a background music in a menu, but I am having problems because also I have a sound effect when I press a button but the problem is that when I press a button, the sound effect of the button stops my background music ("backgrounMusic.wav").

Is there a way to prevent this? I want that the background music keeps playing although a button is pressed.

Baum mit Augen
  • 47,658
  • 24
  • 139
  • 177
TheIE100
  • 67
  • 6
  • 1
    http://stackoverflow.com/a/37357872/7852751 Does this help you? Also, check out the entire thread. – afdggfh Apr 28 '17 at 14:25

1 Answers1

0

Not with PlaySound (it is not meant to be used for mixing sounds), either use the multimedia APIs or DirectSound. Or perhaps a not-native library as SDL

Marco A.
  • 42,082
  • 25
  • 129
  • 240