Commit 19fc1bc0 by BellCodeEditor

save project

parent 6642f82e
import os
import pygame
from pygame import locals
......@@ -19,7 +20,18 @@ pygame.mixer.music.set_volume(volume) # 初始播放音量
click = 0
play_button = stop_img
Music_List = ["歌曲1.wav","歌曲2.wav","歌曲3.wav","歌曲4.ogg"]
path = "C:\\Users\\EDZ\\Desktop\\123"
Music_List = []
for file in os.listdir(path):
if file[-4:] == "wav" or file[-4:] == "ogg":
Music_List.append(file)
num = -1
while True:
......@@ -54,7 +66,7 @@ while True:
num += 1
if num > len(Music_List)-1:
num = 0
pygame.mixer.music.load(Music_List[num])
pygame.mixer.music.load(path + "\\" + Music_List[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