Have you ever wanted a speaker that can stream your own music? What about things related to Spotify, Google Music and SoundCloud? Does AirPlay support sound good? In this project, I will show you how to achieve this with an old speaker and a Raspberry Pi.
Step 1: What You Need
You also need an old speaker. I used a Vantage guitar speaker with a built in amp that lay around me. You can pick up similar models for around $50, but any old speaker should work. The Raspberry Pi doesn’t sound great, so if your speakers don’t have a built-in amplifier like mine, you’ll need to add one to your Pi. I like this one from HiFiBerry even though it doesn’t support B+ yet.
You will also need:
- Auxiliary cable
- Socket with two plugs
- Two meters of three-core cable
- Insulating tape or heat shrink
- Heavy Duty Mounting Tape
- Solder and soldering iron
- Various screwdrivers
- Wire stripper
Step 2: Flashing pi
Before you start building, it is important that your Raspberry Pi is working properly. For this project, I’m using Wouter van Wijk’s Pi MusicBox operating system.
Download and extract the file .zip from Wouter website.
There are many ways to flash or install a disk image on an SDCard for Raspberry Pi. GUI interfaces are simpler, but not as robust as if you did it yourself from the command line. The Embedded Linux Wiki contains a complete guide to the various methods available for each platform. Follow the instructions they provide. If one method doesn’t work, try another.
Once the MicroSD card has been flashed, use Windows Explorer or Finder to navigate to the folder configuration and open settings.ini file in a text editor.
Under network settings enter your WiFi details and save the file. You can also name your speaker; default name — musicbox, but i named mine TheAmp . My first choice TheAwesomeAmp was too long.
Now you can configure everything, but it’s easier through the web interface.
Step 3: Set up your Pi MusicBox
Insert a microSD card into the Pi. Insert some headphones into the audio output port and connect it to a power source. Wait about 90 seconds for it to fully load.
On your computer, point the browser to [имя динамика] .local . In my case it is theamp.local . If everything went well, connect the speaker via the Music Player Daemon (MPD) web interface. If it doesn’t, get shooting problems!
Open the settings menu and set up your services. Typically, you’ll just need to add your login details, although for some, like SoundCloud, you’ll need to follow the steps they provide to get an authentication token.
If you’re just using the Pi’s audio output like I do, the menu Audio select analog for audio output .
Click Update settings and wait for the Pi to reboot.
Reconnect using the web interface and put on your headphones and play something. After a couple of seconds, you will hear the song you have chosen.