Simple HAM repeater controller in bash
authorTomas Mudrunka <tomas@mudrunka.cz>
Fri, 13 Mar 2015 11:25:32 +0000 (12:25 +0100)
committerTomas Mudrunka <tomas@mudrunka.cz>
Fri, 13 Mar 2015 11:25:32 +0000 (12:25 +0100)
bash/parrot.sh [new file with mode: 0755]

diff --git a/bash/parrot.sh b/bash/parrot.sh
new file mode 100755 (executable)
index 0000000..4533f02
--- /dev/null
@@ -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
+
+
This page took 0.179594 seconds and 4 git commands to generate.