Commit b22126d9 by BellCodeEditor

save project

parent e6a42acf
Showing with 9 additions and 2 deletions
import pygame
from pygame import locals
import os
click=False
......@@ -13,7 +14,12 @@ stop_img = pygame.image.load('stop.png') # 暂停按钮
last_img = pygame.image.load('last.png') # 上一曲按钮
next_img = pygame.image.load('next.png') # 下一曲按钮
logo_img = pygame.image.load('logo.png') # 下一曲按钮
mlist=['1.mp3','歌曲1.wav','歌曲2.wav','歌曲3.wav','歌曲4.ogg']
mlist=os.listdir(r"C:\Users\张国耀\Desktop\1")
a=-1
for file in mlist:
a+=1
if file[-4:] != (".wav",".ogg",".mp3"):
mlist.pop(a)
# 载入音乐
num=-1
pygame.mixer.music.load(mlist[num]) # 载入音乐
......@@ -58,7 +64,8 @@ while True:
num=0
else:
num+=1
pygame.mixer.music.load(mlist[num])
path="C:\\Users\\张国耀\\Desktop\\1\\"
pygame.mixer.music.load(path+mlist[num])
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