Intro
Since Teddycloud can play radio streams, I’d highly recommend a very nice open source software named OwnTone (formerly forked-daapd). I’ve been using it for more than 10 years.
OwnTone is a media server that lets you play audio sources such as local files, Spotify, pipe input or internet radio to AirPlay 1 and 2 receivers, Chromecast receivers, etc. Or you can listen to your music via any client that supports mp3 streaming.
You control the server via a web interface, Apple Remote, an Android remote (e.g. Retune), an MPD client, json API or DACP. OwnTone runs on low power devices like the Raspberry Pi.
Killer Feature
What makes OwnTone a perfect fit for the Teddycloud is that it has a built-in radio stream ouput! So no matter where the input comes from (local, Spotify, AirPlay etc.), everything will be transmitted to http://[OWNTONE-IP]:3689/stream.mp3
. You don’t have to setup anything like an icecast server, no need to configure complicated mpd config files etc. It just works!
So out of the box, just by running OwnTone (e.g. as a Docker container), you can assign its output stream to a Tonie of your choice and then you can change dynamically in OwnTone’s web interface what this Tonie is playing. Switch between different radio stations, your personal music library, Spotify etc.
Extensions
There’s another fince peace of software named Shairport-Sync. It turns every device into an AirPlay destination! Meaning you can send any audio from your iOS/macOS (even Android) device via AirPlay to your Shairport host. And Shairport can write this stream e.g. into a Unix pipe (FIFO). One feature of OwnTone is that it automatically starts playing a pipe as soon as somebody writes to it. So both of them work perfect together. So here’s a possible chain:
iPhone → AirPlays to Shairplay → outputs to pipe → read by OwnTone → outputs to radio stream → received by Teddycloud → outputs to Toniebox.
This sounds way more “complicated” than it is. It offers endless possibilities, as you can play basically everything your mobile phone can play (YouTube, Amazon Music, Podcasts, and many more).
Besides OwnTone’s native Spotify integration or AirPlay, there is also the possibility to install Librespot or Spocon (recommended) on your Pi. This way, you have native Spotify Connect support. Spocon can output to a pipe as well and OwnTone listens on this and starts playing it automatically (same as with Shairport).
Installation
All of the tools above can be installed either native or via Docker. You can run them on the same machine, for example a Raspberry Pi. Here’s a detailed setup guide for OwnTone and Shairport (Home Assistant parts can be ignored).
One more thing
OwnTone has a nice RESTful API which offers lots of possibilities for automations, remote controls (e.g. via Siri Shortcuts, Scripts) etc. Example: trigger Siri Shortcut with NFC (or voice) which shuffles a random episode of “Die drei ???” on Spotify and play it on OwnTone.