I have been building a game and I have been trying to add some background music for the menu. When I run the code though, all I get is a windows sound (Either notification or error sound, I don't know which) and then it just runs the rest of the program.
def background_menu():
winsound.PlaySound("Menu Music.mp3", winsound.SND_ALIAS)
thread = Thread(target=background_menu)
thread.start()
menu_title()
background_menu()
plays the music: Which is called 'Menu Music.mp3'
.
As you can see I have used a thread to run it in the background with from threading import Thread
at the begginning of the code.
Then the function menu_title()
displays the rest of the menu.
I am trying to use the thread to run it in the background. I think python just can't access the file (Which is in the same folder btw) I have also tried running as administrator and I am logged in as administrator. No syntax error appears.