Code: Select all
import os
loop = 0
os.system('clear')
os.system('ls -1pR mp3s > files.out')
f = open('files.out', 'r')
A = f.readline()
C = ['this','is','a','list']
C[:] = []
if A[-2:-1] == ":":
while loop == 0:
B = f.readline()
if B[-2:-1] == ":":
A = B
if B[-5:-1] == ".mp3":
C[len(C)+1:] = [A[:-2] + '/' + B[:-1]]
if B == "":
loop = 1
I tried using mpg321 to play the tracks but couldn't work out how to play them 1 at a time.
I tried using pyglet.media.Player() but couldn't work anything out at all.
My aim is for a non-GUI media player that will pause/play, go forward a track, go back a track, go forward a folder and go back a folder.
I work on linux (debian) and haven't programmed much for 20 years.
The aim is to stick a non-networked Pi into an old stereo (car), auto log on, auto start the programme and eventually use GPIO connections to do the 5 functions (pause/play, go forward a track, go back a track, go forward a folder and go back a folder). The stereo jack would then be soldered to the amp, replacing the radio.
Any ideas?
Thanks in advance.