music: Add soundboard

This commit is contained in:
polyfloyd 2022-10-19 21:59:07 +02:00
parent 97a4e95ca8
commit 2e47c6744f
7 changed files with 141 additions and 0 deletions

View file

@ -0,0 +1,16 @@
# Managed by Ansible
[Unit]
Description=Goodbye
Requires=mpd.service
[Service]
Type=oneshot
ExecStart=/bin/true
ExecStop=/opt/shutdown.sh
RemainAfterExit=true
User=audio
Group=audio
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,8 @@
#!/bin/bash
# Managed by Ansible
systemctl stop trollibox.service
mpc clear
su audio -c 'mplayer -volume 10 -ao jack:name=MPlayer /opt/sounds/shutdown.mp3'

View file

@ -0,0 +1,15 @@
# Managed by Ansible
[Unit]
Description=MQTT Soundboard
After=network.target
[Service]
Type=simple
ExecStart=/opt/soundboard/.venv/bin/python /opt/soundboard/soundboard.py /etc/soundboard.yaml
Restart=always
RestartSec=10
User=root
[Install]
WantedBy=multi-user.target

View file

@ -0,0 +1,21 @@
loglevel: INFO
mqtt:
host: mqtt.bitlair.nl
sounds:
directory: /opt/sounds
play_cmd: "mplayer -volume 10 -ao jack:name=MPlayer %s"
topic: bitlair/soundboard
aliases:
- sound: space_open
topic: bitlair/state
value: open
- sound: space_close
topic: bitlair/state
value: close
- sound: doorbell
topic: bitlair/doorduino/doorbell
- sound: nomunnie
topic: bitlair/bank/shame