Inspired by a recent post on reddit, I wanted to code something up that allowed me to manipulate physical devices to play music from my computer. The idea here is that, given an NFC reader (which will eventually be embedded in a nice looking box) and some NFC stickers attached to printed out album art, we should be able to play music from the harddrive of a raspberry pi just by putting the album art on the box.
Instead of using the spotify apis to hook up with Sonos, we are associating spotify URIs with local paths. Playlists are created and delivered to VLC (installed locally on the raspberry) and played through the audio jack.
To view a demo of the prototype: https://youtu.be/z2we-WwWUfo
Band | Album | Spotify URI |
---|---|---|
Alkaline Trio | Goddamnit! | spotify:album:3bic2qlxGauU2dVSCrinLY |
Black Sabbath | Paranoid | spotify:album:6r7LZXAVueS5DqdrvXJJK7 |
DJ Shadow | Entroducing | spotify:album:4wvqGLk1HThPA0b5lzRK2l |
Jobim | The Unknown Antonio Carlos Jobim | spotify:album:3ToNGp8ny9FOcjcZRn5I08 |
Lovage | Music To Make Love To Your Old Lady By | spotify:album:3QFwPfYolMmXNNdOrRLLGE |
Muddy Waters | I'm Ready | spotify:album:4mh3XUBkBiIpCCriJ4mYNP |
Various Artists | Moana OST | spotify:album:6pZj4nvx6lV3ulIK3BSjvs |
What the following python code does is to get a plex server object (for the desktop), get a list of albums, grabs the first album off the list, and then gets the second track from that album. Then it gets a stream url for that track, which can be put as a path for a media_list using the vlc controller
Next thing todo: Pull the generation of the tracklist out of VLCController into a separate class, which can federate between the filesystem and the plexcontroller (for a list of paths to send to the media list generator)