Skip to content
A computer vision powered record player that runs on a Raspberry Pi
JavaScript Python HTML CSS
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
public
views
.env.example
.gitignore
LICENSE.md
README.md
apiChain.js
camera.py
camera_test.py
censoredWords.js
googleVision.js
package-lock.json
package.json
server.js
spotify.js

README.md

Record Player for Raspberry Pi

This is a version of Record Player that will run on a Raspberry Pi. It requires a camera module for the Raspberry Pi. You do not need a screen, but it helps to get the camera positioned correctly.

This is a Rube Goldberg Machine of the Google Cloud Vision API and the Spotify API. After logging into Spotify, upload an image. The image will be sent to the Google Vision API, which will guess what it is. The app will then search Spotify using Google's guess, and give you the first result to play.

You will need the following to make your own:

  • Google Cloud API Key (this is set as GCP_API_KEY ENV variable)
  • Create a Spotify App (SPOTIFY_CLIENT_ID and SPOTIFY_CLIENT_SECRET ENV variables)
  • SPOTIFY_STATE_STRING env variable is used to confirm the correct redirect during Spotify auth.

Set PORT ENV variable to 3000

On the Raspberry Pi:

  • Set Chromim to allow spotify to play music:

    • Settings > Advanced > Content Settings > Flash
    • Install 'User-Agent Switcher for Chome' from Chrome web store
    • Set User-Agent to Firefox Windows

Starting the apps:

Start the Node.js server:

PORT=3000 npm start

In another terminal tab or after sending the node server to the backgorund, start the Python camera script:

python3 camera.py

Demo:

Video here: https://player.vimeo.com/video/288443309

You can’t perform that action at this time.