Commit d29d5690 by BellCodeEditor

save project

parent 86d6ab7f
Showing with 6 additions and 3 deletions
......@@ -13,12 +13,15 @@ last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮
m_l = []
path = "C:\\Users\\Administrator\\Desktop\\test"
fl = os.listdir(path)
print(fl)
for i in fl:
if i[-4:] == '.wav' or i[-4:] == '.ogg':
m_l.append(i)
# 载入音乐
m_l = ['歌曲1.wav','歌曲2.wav','歌曲3.wav','歌曲4.ogg']
n = -1
volume = 0.2
......@@ -61,7 +64,7 @@ while True:
n += 1
if n > len(m_l) - 1:
n=0
pygame.mixer.music.load(m_l[n])
pygame.mixer.music.load(path + '\\'+m_l[n])
pygame.mixer.music.play()
# 绘制画面
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment