Commit 62e81df9 by BellCodeEditor

auto save

parent 4fbca426
Showing with 6 additions and 5 deletions
...@@ -20,11 +20,12 @@ volume = 0.2 ...@@ -20,11 +20,12 @@ volume = 0.2
pygame.mixer.music.set_volume(volume) # 初始播放音量 pygame.mixer.music.set_volume(volume) # 初始播放音量
click = 0 click = 0
play_button = stop_img play_button = stop_img
c=os.listdir("C:\\Users\\EDZ\\Desktop\\test")
a=[] a=[]
for i in c:
for i in range(): if i[-4:]==".wav" or i[-4:]==".ogg":
if i[-4:]=='.wav' or file[-4:]=='.ogg': a.append(i)
a.append(i) print(a)
b=-1 b=-1
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
...@@ -64,7 +65,7 @@ while True: ...@@ -64,7 +65,7 @@ while True:
b+=1 b+=1
if b>len(a)-1: if b>len(a)-1:
b=0 b=0
pygame.mixer.music.load(a[b]) pygame.mixer.music.load("C:\\Users\\EDZ\\Desktop\\test\\"+a[b])
pygame.mixer.music.play() pygame.mixer.music.play()
print(a[b]) print(a[b])
......
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