Close

We Don't Need No Stinking Playlists

A project log for VoiceBox

Adding a Flask web interface (and other stuff) to the Google AIY Voice Kit.

tmTM 08/15/2018 at 20:110 Comments

When I started playing with mpd the natural progression was to keep adding more radio streams to a single (unsaved) playlist. I then added voice commands to switch to the next stream, wrapping back to the beginning of the list. This only worked until the music stopped. as the Google Assistant can't be relied on to recognize the phrase "Hey Google, next stream" while the radio announcer is talking.

So I needed a web interface to select radio streams, but I was then presented with the problem that there's no consistency is the quality or quantity of meta information provided by different streams, e.g. BBC Radio 3 returns the single title string "bbc_radio_three" regardless of what's playing, with no info in any other fields.

My chosen solution is to split the list into single stream playlist files, with meaningful names, and to display whatever currentsong() information the stream chooses to return.

I can then select streams from a drop-down list box which lists the contents of the directory ~/.mpd/playlists:

I've left the "next song" functionality in VoiceBox in case I ever want to play lists of .mp3 files, but for now, the single stream .m3u files suit my needs.

In the unlikely event that you share my taste in music, download the file playlists.zip and extract to directory ~/.mpd/playlists (assuming that's where /etc/mpd.conf points to).

Discussions