Add static sound. Add predefined announcements and helper scripts.

This commit is contained in:
Dejvino 2021-01-09 14:18:49 +01:00
parent 059d555463
commit ccc5c82dba
11 changed files with 72 additions and 1 deletions

5
bin/megaton_radio.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
VOL=25
mplayer "http://us2.internet-radio.com:8443/;stream" -cache 1024 -cache-min 20 -volume $VOL -softvol -channels 2 -af pan=1:0.5:0.5

4
bin/pipe_announcement Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
mosquitto_pub -t vault/psa/announcement -l

9
bin/schedule_announcement Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
TIME=$1
shift
at "$TIME" <<EOT
cd ~/build/vault-announcer/bin
./announce-freeform "$@"
EOT

9
bin/schedule_emergency Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
TIME=$1
shift
at "$TIME" <<EOT
cd ~/build/vault-announcer/bin
./emergency-freeform "$@"
EOT

26
bin/schedule_meeting Executable file
View File

@ -0,0 +1,26 @@
#!/bin/bash
function time_minus_minutes() {
time="$1"
change="$2"
difference=$(($change * 60))
result=$(( $(date -d "$time" "+%s") - $difference ))
echo `date -d "@$result" "+%H:%M"`
}
TYPE=$1
shift
TARGET=$1
shift
SLACK=5
TIME=`time_minus_minutes "$TARGET" "$SLACK"`
NAME="$@"
MSG="Meeting in $SLACK minutes. ... Meeting '$NAME' in $SLACK minutes."
#echo "Scheduling $TYPE for meeting '$NAME' at $TARGET in $SLACK minutes in advance, at $TIME."
~/schedule_${TYPE} "$TIME" "$MSG"

View File

@ -0,0 +1,4 @@
#!/bin/bash
~/schedule_meeting announcement $@

4
bin/schedule_meeting_emergency Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
~/schedule_meeting emergency $@

5
bin/start_announcement_server Executable file
View File

@ -0,0 +1,5 @@
#!/bin/bash
cd ~/build/vault-announcer/bin/
mosquitto_sub -t vault/psa/announcement | ./announcement-server

4
bin/submit_announcement Executable file
View File

@ -0,0 +1,4 @@
#!/bin/bash
mosquitto_pub -t vault/psa/announcement -m "$@"

View File

@ -6,4 +6,5 @@
* Source: [freesound.org](https://freesound.org/people/chimerical/sounds/105228/) * Source: [freesound.org](https://freesound.org/people/chimerical/sounds/105228/)
* `alarm_simple.ogg` * `alarm_simple.ogg`
* Source: [freesound.org](https://freesound.org/people/Suburbanwizard/sounds/440307/) * Source: [freesound.org](https://freesound.org/people/Suburbanwizard/sounds/440307/)
* `static.ogg`
* Source: [freesound.org](https://freesound.org/people/Jay_You/sounds/384090/)

BIN
sounds/static.ogg Executable file

Binary file not shown.