My Pirate Jukebox

I recently took delivery of the Pirate Radio kit and had a lot of fun making it into an Airplay Speaker using the awesome tutorial written by the Pimoroni Crew! However… I had other plans!

My kid loves his music and often hogs our TV watching his favourite songs on YouTube so I decided to turn my Pirate Radio into a Pirate Jukebox! I’ve written a simple Python script based on the examples in the Phat Beat library to play a random song from a directory of MP3s.

I have most of the buttons functioning: the FFWD button plays a random song, PLAY/PAUSE pauses the song, RRWD goes back to the start of the song and the volume buttons do the expected job. Not using the power button right now (mostly because it’s not really accessible on the Pirate Radio kit)

Quick demo video here (sorry for the crappy filter, my kid insisted)

If you want to make something similar, I’ve uploaded the code to Github here:

I’m a very amateur Python dev and have hacked this together but it seems to work pretty reliably. Feel free to make suggestions or submit pull requests on Github with improvements!

1 Like

A nice build. :)

1 Like

Quick update! Being an inexperienced python dev I was certain this script was going to crash or be unreliable but amazingly it’s now been going for 48 hours and is working solidly (including 24 hours of continuous play with the volume off!)! I’m really quite surprised there are no memory leaks or dodgy code exceptions that are causing it to break but so far, so good!

1 Like

If my code was involved it’d be on fire by now :) Good stuff.

1 Like

I’m so pitching this code for my PiWars robot radio! 😀

1 Like

I can’t wait to see this! Please share it when you’re done!