From ef86afe3bfc045512e5009ebf013dc3983392431 Mon Sep 17 00:00:00 2001 From: Ashhhleyyy Date: Mon, 15 Apr 2024 10:20:32 +0100 Subject: [PATCH] feat: add systemd services for infinite silence --- infinite-silence-stream.service | 11 +++++++++++ infinite-silence.service | 13 +++++++++++++ jackd.service | 9 +++++++++ 3 files changed, 33 insertions(+) create mode 100644 infinite-silence-stream.service create mode 100644 infinite-silence.service create mode 100644 jackd.service diff --git a/infinite-silence-stream.service b/infinite-silence-stream.service new file mode 100644 index 0000000..ed75aa3 --- /dev/null +++ b/infinite-silence-stream.service @@ -0,0 +1,11 @@ +[Unit] +Description=Infinite silence stream +Requires=jackd.service + +[Service] +ExecStart=/usr/bin/ffmpeg -ac 1 -f jack -i infinite-silence -c:a libmp3lame -b:a 192k -ac 1 -content_type 'audio/mpeg' -f mp3 icecast://source:iamapassword@localhost:8016/silence +Restart=on-failure + +[Install] +Also=jackd.service +WantedBy=default.target diff --git a/infinite-silence.service b/infinite-silence.service new file mode 100644 index 0000000..d86e427 --- /dev/null +++ b/infinite-silence.service @@ -0,0 +1,13 @@ +[Unit] +Description=Complete silence, always +Requires=jackd.service +Requires=infinite-silence-stream.service + +[Service] +ExecStart=/usr/bin/python3 /home/ash/silence/infinite-silence.py infinite-silence 5 30 /home/ash/silence/sfx.mp3 +Restart=on-failure + +[Install] +Also=jackd.service +Also=infinite-silence-stream.service +WantedBy=default.target diff --git a/jackd.service b/jackd.service new file mode 100644 index 0000000..36ba9bd --- /dev/null +++ b/jackd.service @@ -0,0 +1,9 @@ +[Unit] +Description=jackd + +[Service] +ExecStart=/usr/bin/jackd -t5000 -r -dalsa -r48000 -n3 +Restart=no-failure + +[Install] +WantedBy=default.target