From c4c7dacb30ceea0bfbe006b8087ba4864ad1dd83 Mon Sep 17 00:00:00 2001 From: Tomas Mudrunka Date: Fri, 13 Mar 2015 12:25:32 +0100 Subject: [PATCH] Simple HAM repeater controller in bash --- bash/parrot.sh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 bash/parrot.sh diff --git a/bash/parrot.sh b/bash/parrot.sh new file mode 100755 index 0000000..4533f02 --- /dev/null +++ b/bash/parrot.sh @@ -0,0 +1,28 @@ +#!/bin/bash +#This is simple audio echoing script +#usefull as virtual parrot or simple HAM repeater controller + +file='/tmp/out.wav' +silence_treshold='8%' +silence_timeout='3' +message_timeout='60' +message_delay='1' +message_intro='repeat' +normalize_db='-1' + +while :; do + echo -e "====> RECORDING\t$file, treshold $silence_treshold, timeout $silence_timeout" + rec -c 1 -r 22050 "$file" \ + silence 1 0 $silence_treshold 1 00:00:$silence_timeout $silence_treshold \ + trim 0 $message_timeout + echo -e "====> DELAY\t$message_delay seconds" + sleep $message_delay + [ -n "$message_intro" ] && { + echo -e "====> TTS\t$message_intro" + which espeak && espeak -- "$message_intro" + } + echo -e "====> PLAYING\t$file, normalizing to $normalize_db dB" + play --norm=$normalize_db "$file" +done + + -- 2.30.2