announcement-box/bin/pa-lib

52 lines
860 B
Plaintext
Raw Normal View History

#!/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 "$@"
}