i.e. if it printed A1 it would play A1.mp3,
would be great if it was possible to queue songs to be played next also.
Please could someone write an example as i have not been able to get an answer from anyone.
I am just learning !
Thanks for your help.
here is what someone suggested but it didn't work;
Code: Select all
track = SELECTION_LETTERS[count_of_letter_pulses-1] + str((count_of_number_pulses-1))
message = ("+++ TRACK FOUND +++ Track Selection: ", track)
logger.info (message)
return track
def play_song(track) :
print "Playing Track %s" % track
global ACTIVE_PROCESS
if ACTIVE_PROCESS:
ACTIVE_PROCESS.terminate()
ACTIVE_PROCESS = subprocess.Popen(["mpg321", "/Desktop/2/%s.mp3" % track]) 