Home>
I don't understand the meaning of'filename'in the sample code I looked up in pygame. Error message
>>>import pygame.mixer
pygame 1.9.4
Hello from the pygame community.https: //www.pygame.org/contribute.html
>>>import time
>>>pygame.mixer.init ()
>>>pygame.mixer.Sound.load ('[Alexandros]-Wandering (MV) .mp3') I tried putting music files in #windows
Traceback (most recent call last):
  File "<stdin>", line 1, in<module>
AttributeError: type object 'Sound' has no attribute 'load'
>>>pygame.mixer.music.load ('[Alexandros]-Wandering (MV) .mp3')
Traceback (most recent call last):
  File "<stdin>", line 1, in<module>
pygame.error: Couldn't open '[Alexandros]-Wandering (MV) .mp3'
Applicable source code
import pygame.mixer
import time
# initialize mixer module
pygame.mixer.init ()
# Load music files
pygame.mixer.music.load ("file name.mp3") # ← I don't know what this file name means and what to do
# Set music playback and playback count (-1 is loop playback)
pygame.mixer.music.play (-1)
time.sleep (60)
# End playback
pygame.mixer.music.stop ()

I'm a beginner and there are a lot of lack of explanation.