I have no idea when I executed my code and it said "pygame.error". When I click "Run "menu"" in pycharm, it would give me "pygame.error". If I click "Debug "menu"", my program will smoothly operate and load the music properly. I don't know how that happened. Hope to find some helps here.
https://i.stack.imgur.com/xx81D.png -> the left is "Run" button, right one is "Debug" button.
Here is the error feedback:
Traceback (most recent call last):
File "D:/pywork/menu.py", line 65, in <module>
G.run()
File "D:/pywork/menu.py", line 43, in run
pygame.mixer.music.load("bgm//disillusion.mp3")
pygame.error
And here is my code:
if keys[pygame.K_RETURN]:
pygame.mixer.init()
pygame.mixer.music.load("bgm//disillusion.mp3")
pygame.mixer.music.play(-1, 0.0)
Thanks in advance.