使用Python制作mp3 - 无法打开音乐文件夹

时间:2018-05-19 11:13:07

标签: python python-3.x pygame

import os
import pygame
from tkinter.filedialog import askdirectory
from mutagen.id3 import ID3
from tkinter import*
from PIL import ImageTk
root = Tk()
root.minsize(300,300)
root.wm_title("Miusic player ")

问题在于,当我运行代码时,它会说"无法打开音轨"。

 def filechooser():
        file = os.listdir("/home/pi/Desktop/project/miusic/Pendulum/Propane Nightmares")
        for files in file:

            if files.endswith(".mp3"):
                 listofmaltesesongs.append(files)
                 print(files)
            pygame.mixer.init()
        pygame.mixer.music.load(listofmaltesesongs[0])
        pygame.mixer.music.play()


    filechooser()




    root.mainloop()

0 个答案:

没有答案