How to play winsound.playsound('file.wav', 0) and have the next line of code executed?

30 Views Asked by At

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?

0

There are 0 best solutions below