0

I'm trying to make a super simple adventure print("") game, and I'd like to have music in the background. This is my current code.

import time
import winsound

winsound.PlaySound('file.wav', 0)

print("Hello player! This is a simple project I'm working on as I am new to python!")

And the print("") story continues.

Currently, the playsound function works but the program won't execute the next line until the sound is fully done. How can I solve this?

doneforaiur
  • 1,308
  • 7
  • 14
  • 21
Realism
  • 11
  • 1
  • You simply need to pass the winsound.SND_ASYNC flag for the function, there are multiple examples on stackoverflow: [python-playing-a-music-in-the-background](https://stackoverflow.com/questions/17929990/python-playing-a-music-in-the-background) – Károly Szabó Aug 17 '23 at 10:30

0 Answers0