Weekend Tech fun!
Credits to: Andrew Faden for BabelPod & mcfisto for Airtunes2
Stream music from Vinyl/MD/CD or Tape to Airplay speaker such as Homepod or Sonos.
To follow these instruction you will need a Raspberry Pi, imaged with raspian lite, cables to hook up your external audio source such as phono to 3.5mm jack for your on board jack with Raspberry Pi 3 – 4 or a USB sound card for the Raspberry Zero (USB Card can also work for all Raspberry Pi)
Once Raspian is installed expand the file system to use full sd-card (4gb will do) and enable SSH
When you have found the IP of your Raspberry Pi SSH on to it using Putty or Terminal
Run each of the following command line by copying and pasting:
$ wget https://nodejs.org/dist/v9.8.0/node-v9.8.0-linux-armv6l.tar.xz
$ sudo mkdir /usr/local/lib/nodejs
$ sudo tar -xJvf node-v9.8.0-linux-armv6l.tar.xz -C /usr/local/lib/nodejs
$ sudo mv /usr/local/lib/nodejs/node-v9.8.0-linux-armv6l/ /usr/local/lib/nodejs/node-v9.8.0
$ nano ~/.profile
Add the following lines to the bottom of profile and save and close by pressing ctrl and x
# Nodejs
export NODEJS_HOME=/usr/local/lib/nodejs/node-v9.8.0
export PATH=$NODEJS_HOME/bin:$PATH
Reload the changes just made by running the following command
source ~/.profile
Next the important bit installing airtunes2 – this is needed for new Apple Devices
pi@raspberrypi:~/ $ git clone -b fix_port_0_error https://github.com/mcfisto/node_airtunes2.git
pi@raspberrypi:~/ $ cd node_airtunes2
pi@raspberrypi:~/node_airtunes2 $ npm install
pi@raspberrypi:~/node_airtunes2 $ cd ..
Next we install the web front end, this is used to control where your source music is played from and to
pi@raspberrypi:~ $ git clone https://github.com/maexdaemaege/babelpod.git
pi@raspberrypi:~ $ cd babelpod
pi@raspberrypi:~/babelpod $ npm install
pi@raspberrypi:~/babelpod $ node index.js
The last command in the text file above should starts the program and all being well you should be able to goto any browser and goto http://ip.of.raspberrypi:3000 from there Chose the Input (Where you music is being played from) and Output the speaker of your choice, the volume slider at the bottom allow you to control the volume of that speaker.
Optional: Making BabelPod startup automatically when the Rasberry Pi boots up:
sudo nano /etc/systemd/system/babelpod.service
copy the below text and Ctrl & x to save the file
[Service]
# need to specify the full path to node
ExecStart=/usr/local/lib/nodejs/node-v9.8.0/bin/node /home/pi/babelpod/index.js
StandardOutput=journal
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.target
Next time the Raspberry Pi reboots BabelPod will automatically start.
*Please note you will still need to choose the input and output when this happens.