Robotický Správce Deace
A system with a web GUI to play songs and TTS utterances on multiple devices at once. Made for Deace.
- Play songs and TTS utterances on a network of synchronized devices (old phones / laptops, Raspberry Pis, etc.)
- Add background music to TTS voice
- Control what is played from anywhere using a web interface
- Schedule events for a specific time
- Browse and search the play history
At the current state, the system is tuned for using a Czech TTS voice and has quick access presets for alarm, playtime, lunch and dinner music.
The files in data/audio
are just empty stubs, you need to replace them with actual audio files. Any format supported by mpd
should work, not just MP3. (The files in data/background
are real out of the box.)
The audio presets can be edited in RSD/presets.py
.
Recommended: Ubuntu 22.04, everything else is hic sunt leones.
- Install
uv
:curl -LsSf https://astral.sh/uv/install.sh | sh
- Start a new terminal so that
uv
is properly loaded, and set up the project using:uv sync
- Install MPD and Snapcast, but don't let the default service run:
sudo apt install -y mpd snapserver snapclient
sudo systemctl disable snapserver
sudo pkill snapserver
- Download models using:
echo test | uv run piper --model cs_CZ-jirka-medium >/dev/null
uv run honcho start
Access the web interface on http://<host IP>:8080
.
WARNING: When first generating audio, the models need to be downloaded. This can take a while and the server will be unresponsive during that time.
TIP: Use ngrok or devtunnel to expose the web interface to the internet and play songs from anywhere!
The clients connect to host IP on port 1704 (stream port) and 1705 (control port). The Android client has a "scan" feature so you don't have to type the IP manually.
Install snapclient
and run:
snapclient -h <host IP>
Install and use the application Snap.Net.
Install and use the application Snapcast.
It uses NiceGUI, which is a clever Python UI framework that automatically creates a Vue frontend for Python code, communicating through websockets. It's the exact kind of thing you would use for a project like this.
The file conf/snapserver.conf
instructs the server to buffer 3s of audio before playing. This ensures smoother sync.
When the connection is shitty and snapcast is unable to sync with the server, it will stay silent until it catches up. Not much else can be done other than improving the connection.