Browse Source

Add emergency test, announce time and weather

master
Dejvino 3 years ago
commit
74c1f77349
8 changed files with 121 additions and 0 deletions
  1. +20
    -0
      bin/announce-time
  2. +24
    -0
      bin/announce-weather
  3. +26
    -0
      bin/emergency-test
  4. +51
    -0
      bin/pa-lib
  5. BIN
      sounds/announcement_4-tone_up.ogg
  6. BIN
      sounds/announcement_4-tone_up_quickest.ogg
  7. BIN
      sounds/announcement_4-tone_up_smooth.ogg
  8. BIN
      sounds/announcement_4-tone_up_smooth_quick.ogg

+ 20
- 0
bin/announce-time View File

@@ -0,0 +1,20 @@
#!/bin/bash

source pa-lib

pa-preheat

pa-announcement

DATE=`date +"%B %d, %Y"`
pa-say "The date is $DATE."

sleep "0.5"

TIME=`date +"%l %p and %M minutes"`
pa-say "It is $TIME."

pa-announcement-quick

pa-shutdown


+ 24
- 0
bin/announce-weather View File

@@ -0,0 +1,24 @@
#!/bin/bash

source pa-lib

WFILE=/tmp/weather
LOCATION="BRQ"

info "Fetching weather report for $LOCATION."
weather -q -m $LOCATION > $WFILE

pa-preheat

pa-announcement

pa-say "Here is the latest weather report:"
cat $WFILE
pa-say -f "$WFILE" -l 80

pa-say "Have a great day!"

pa-announcement-quick

pa-shutdown


+ 26
- 0
bin/emergency-test View File

@@ -0,0 +1,26 @@
#!/bin/bash

source pa-lib

pa-preheat

pa-announcement-quickest

pa-say "Test of emergency warning system will begin."

sleep 1

emergency-light on
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."

sleep 1

emergency-light off

pa-say "This was a test of the emergency warning light system. Thank you for your cooperation."

pa-announcement-quick

pa-shutdown


+ 51
- 0
bin/pa-lib View File

@@ -0,0 +1,51 @@
#!/bin/bash

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
export ROOT=`dirname "$DIR"`
export SOUNDS=$ROOT/sounds

export PLAYER=mplayer
export SPEAK=espeak-ng

function info() {
echo "[INFO]" $@
}

function play() {
$PLAYER $@ > /dev/null 2>&1
}

function pa-preheat() {
info "PA Preheating"
pa-power off
play $SOUNDS/announcement_4-tone_up_quickest.ogg
pa-power on
info "PA Ready"
}

function pa-shutdown() {
info "PA Shutdown"
pa-power off
}

function pa-announcement() {
info " DING DONG "
play $SOUNDS/announcement_4-tone_up_smooth.ogg
}

function pa-announcement-quick() {
info " Ding Dong "
play $SOUNDS/announcement_4-tone_up_smooth_quick.ogg
}

function pa-announcement-quickest() {
info " ding-dong "
play $SOUNDS/announcement_4-tone_up_quickest.ogg
}

function pa-say() {
info "Say: $@"
$SPEAK "$@"
}



BIN
sounds/announcement_4-tone_up.ogg View File


BIN
sounds/announcement_4-tone_up_quickest.ogg View File


BIN
sounds/announcement_4-tone_up_smooth.ogg View File


BIN
sounds/announcement_4-tone_up_smooth_quick.ogg View File


Loading…
Cancel
Save