Song Player

I am building a Alarm Clock Radio. One of its features is to be able to play songs from a library.

I wasn't quite sure what features would be required in a song player. So, I wrote a python script to play the songs. I diddled with this for a while until it seemed to do everything I wanted. Eventually, I will add the commands in the python script to the Alarm Clock GUI.

Parts:

  • Raspberry Pi 3

  • HiBerry AMP2

  • 1 or 2 Speakers

Step 1. Set up Raspberry Pi 3

For easy access from my laptop, I enabled the following:

  • OpenSSH

  • avahi-daemon

  • On-board Wi-Fi

Step 2. HiBerry AMP2

Step 3. Music Basics

Create directory /home/pi/radio

Step 4. Add the python 3 script to Raspberry Pi

cd to the /home/pi/radio directory and run the command:

$ sudo wget "https://raw.githubusercontent.com/dumbo25/songPlayer/master/songPlayer.py"

Run the script using:

$ python3 songPlayer.py

The first time it will fail - it has to create some files. Run it again and it should work.

Common commands:

Copy file from Raspberry Pi 3 to laptop. Open a terminal window on MacBook laptop. Navigate to whatever directory you want to use as backup for the script and run the command:

$ scp pi@♣hostname♣.local:/home/pi/radio/songPlayer.py .