# My Pirate Jukebox

**URL:** <https://forums.pimoroni.com/t/my-pirate-jukebox/4338>\
**Category:** Projects\
**Created:** [March 18, 2017, 7:25pm UTC](https://forums.pimoroni.com/t/my-pirate-jukebox/4338 "2017-03-18T19:25:53Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![andywarburton](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/andywarburton/32/9795_2.png) [@andywarburton](https://forums.pimoroni.com/u/andywarburton)\
**Post date:** [March 18, 2017, 7:25pm UTC](https://forums.pimoroni.com/t/my-pirate-jukebox/4338/1 "2017-03-18T19:25:53Z")

</div>

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:

> **[andywarburton/pirate\_jukebox](https://github.com/andywarburton/pirate_jukebox)**
>
> pirate\_jukebox - A simple MP3 player for the Pimoroni Pirate Radio

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!

---

<div class="post-metadata">

**Author:** ![Richard](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/richard/32/508_2.png) [@Richard](https://forums.pimoroni.com/u/Richard)\
**Post date:** [March 19, 2017, 4:47pm UTC](https://forums.pimoroni.com/t/my-pirate-jukebox/4338/2 "2017-03-19T16:47:31Z")

</div>

A nice build. :)

…

---

<div class="post-metadata">

**Author:** ![andywarburton](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/andywarburton/32/9795_2.png) [@andywarburton](https://forums.pimoroni.com/u/andywarburton)\
**Post date:** [March 20, 2017, 2:55pm UTC](https://forums.pimoroni.com/t/my-pirate-jukebox/4338/3 "2017-03-20T14:55:21Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![gadgetoid](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/gadgetoid/32/13_2.png) [@gadgetoid](https://forums.pimoroni.com/u/gadgetoid)\
**Post date:** [March 20, 2017, 3:27pm UTC](https://forums.pimoroni.com/t/my-pirate-jukebox/4338/4 "2017-03-20T15:27:45Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![CannonFodder](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/cannonfodder/32/108_2.png) [@CannonFodder](https://forums.pimoroni.com/u/CannonFodder)\
**Post date:** [March 20, 2017, 7:41pm UTC](https://forums.pimoroni.com/t/my-pirate-jukebox/4338/5 "2017-03-20T19:41:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![andywarburton](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/andywarburton/32/9795_2.png) [@andywarburton](https://forums.pimoroni.com/u/andywarburton)\
**Post date:** [March 23, 2017, 4:06pm UTC](https://forums.pimoroni.com/t/my-pirate-jukebox/4338/6 "2017-03-23T16:06:33Z")

</div>

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