0

Every time I play a sound in pygame, the entire game loop pauses and I don't know how to make it so that it starts playing the sound and then continues on with running the other code in the game.

example_sound = pygame.mixer.Sound("sound.mp4")

while True:
  if mouse_clicked:
    example_sound.play() 
    # Has to play entire sound until moving onto the do_something_else() function
    
  do_something_else() 
Rabbid76
  • 202,892
  • 27
  • 131
  • 174
bezlon
  • 1
  • 1
  • 1
    Welcome to Stack Overflow. Please read [ask] and https://stackoverflow.com/help/minimal-reproducible-example. We can only tell you what is wrong with code that you actually show to us. – Karl Knechtel Dec 15 '21 at 02:15
  • what system do you use? Better create minimal working code with this problem so we could simply copy and run it. – furas Dec 15 '21 at 04:14
  • I use the Windows OS. – bezlon Dec 15 '21 at 05:33

0 Answers0