a. Setting up Spotify
To enable streaming music from Spotify, you need a premium account that has e-mail authentication. If you created your account with Facebook, there is an option to add an e-mail password authentication.
This account must use a username and password to authenticate, and not the Facebook authentication.
- Create a Spotify application
- Retrieve the client_id and the client_secret from the application
- Keep this information at hand, and copy it in the “setup/config” file
b. Connecting the Hifiberry
To power the speaker and to improve the sound quality (the default sound quality on the raspberry Pi is … not the best) we are using a Hifiberry AMP+. There are many sound cards that you can use. Some are made specifically for the Raspberry Pi, although most sound cards ought to work. We decided to go with the HiFiBerry because it seemed like the easiest option to get started with at the time, and we’re happy with the result.
The HiFiBerry sits on top of the Raspberry Pi, as a shield. It requires a 12V power source to power itself and the Pi, and has a connector for hooking up speakers. In order to be recognized by the system, some minor modifications must be made to the ALSA config file, but the HiFiBerry tutorials make the process fairly straightforward.
From the /boot/config.txt file, remove the line:
And add the following line (this varies depending on the model of card you are using, here we are using a HiFiBerry AMP+)
And you’re set !