16 lines
386 B
Python
16 lines
386 B
Python
import vlc, phatbeat
|
|
|
|
music_dir = '/home/jducastel/music/'
|
|
|
|
|
|
class player():
|
|
|
|
__init__(self, folder):
|
|
# get list of files in music_dir
|
|
self.files = [ f for f in os.listdir(folder) if os.path.isfile(os.path.join(music_dir,f)) and f.endswith('.mp3') ]
|
|
|
|
def play_all(self):
|
|
for song in self.files:
|
|
p = vlc.MediaPlayer(file)
|
|
p.play()
|