0

In Pygame how would I define which sound I want to play in certain "if" events? I've been able to load them both in I just hit the issue of not playing either on demand. Thanks for helping me in advance.

1 Answers1

1

You need to use a sound object to play sounds.

if condition_one_true:
    sound_one = Sound('sound1.mp3')
    sound_one.play()

if condition_two_true:
    sound_two= Sound('sound2.mp3')
    sound_two.play()
Malik Brahimi
  • 16,341
  • 7
  • 39
  • 70