I decided to use playsound()
to add a background sound in my program. However when I run the program with playsound, the actual game does not load until the song is finished:
from playsound import playsound
#type 'pip install playsound' in command prompt to install library
import random
playsound('audio.mp3')
while True:
min = 1
max = 6
roll_again = "yes"
while roll_again == "yes" or roll_again == "y":
print("Rolling the dices...")
print("The values are....")
print(random.randint(min, max))
print(random.randint(min, max))
roll_again = raw_input("Roll the dices again?")
Usually I would expect the sound to play in the background while the dice game is loaded and being played, however it does not work like this.