Add volume control and more announcement templates.

This commit is contained in:
Dejvino 2020-12-14 14:14:43 +01:00
parent 74c1f77349
commit c93c5acc41
5 changed files with 73 additions and 0 deletions

14
bin/announce-freeform Executable file
View File

@ -0,0 +1,14 @@
#!/bin/bash
source pa-lib
pa-preheat
pa-announcement
pa-say "$@"
pa-announcement-quick
pa-shutdown

15
bin/announce-midnight Executable file
View File

@ -0,0 +1,15 @@
#!/bin/bash
source pa-lib
pa-preheat
pa-volume-quiet
pa-announcement
pa-say "It is midnight."
pa-announcement-quick
pa-shutdown

23
bin/emergency-freeform Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
source pa-lib
pa-preheat
pa-volume-loud
pa-announcement-quickest
emergency-light on
sleep 1
pa-say "$@"
sleep 1
emergency-light off
pa-announcement-quick
pa-shutdown

View File

@ -6,11 +6,13 @@ pa-preheat
pa-announcement-quickest
pa-volume-normal
pa-say "Test of emergency warning system will begin."
sleep 1
emergency-light on
pa-volume-loud
pa-say "This is only a test. In the event of an emergency, this emergency warning light would be used to declare an emergency."
pa-say "This is only a test."
@ -18,6 +20,7 @@ sleep 1
emergency-light off
pa-volume-normal
pa-say "This was a test of the emergency warning light system. Thank you for your cooperation."
pa-announcement-quick

View File

@ -15,9 +15,26 @@ function play() {
$PLAYER $@ > /dev/null 2>&1
}
function pa-volume() {
amixer cset numid=3,iface=MIXER,name='Line Out Playback Volume' $1 > /dev/null
}
function pa-volume-normal() {
pa-volume 15
}
function pa-volume-loud() {
pa-volume 25
}
function pa-volume-quiet() {
pa-volume 8
}
function pa-preheat() {
info "PA Preheating"
pa-power off
pa-volume-normal
play $SOUNDS/announcement_4-tone_up_quickest.ogg
pa-power on
info "PA Ready"
@ -26,6 +43,7 @@ function pa-preheat() {
function pa-shutdown() {
info "PA Shutdown"
pa-power off
pa-volume-normal
}
function pa-announcement() {