Commit 65ec3655 by BellCodeEditor

save project

parent 186835e2
Showing with 3 additions and 4 deletions
...@@ -15,10 +15,10 @@ logo_img = pygame.image.load('logo.png') # 下一曲按钮 ...@@ -15,10 +15,10 @@ logo_img = pygame.image.load('logo.png') # 下一曲按钮
# 音乐 # 音乐
music_list = [] music_list = []
path = "C:\Users\admin\Desktop" path = "C:\\Users\\admin\\Desktop"
filelist = os.listdir(path) filelist = os.listdir(path)
for i in filelist: for i in filelist:
if i[-4:] == ".ogg" or i[-4:] == ".wav": if i[-4:] == ".wav" or i[-4:] == ".mp3" or i[-4:] == ".ogg":
music_list.append(i) music_list.append(i)
num = -1 num = -1
...@@ -75,8 +75,7 @@ while True: ...@@ -75,8 +75,7 @@ while True:
num += 1 num += 1
if num > len(filelist)-1: if num > len(filelist)-1:
num = 0 num = 0
print(num) pygame.mixer.music.load(path +"\\" +music_list[num])
pygame.mixer.music.load(path + "\\"+music_list[num])
pygame.mixer.music.play() 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