Blokovani pres konstantu
[mirrors/Programs.git] / bash / parrot.sh
1 #!/bin/bash
2 #This is simple audio echoing script
3 #usefull as virtual parrot or simple HAM repeater controller
4
5 file='/tmp/out.wav'
6 silence_treshold='8%'
7 silence_timeout='3'
8 message_timeout='60'
9 message_delay='1'
10 message_intro='repeat'
11 normalize_db='-1'
12
13 while :; do
14 echo -e "====> RECORDING\t$file, treshold $silence_treshold, timeout $silence_timeout"
15 rec -c 1 -r 22050 "$file" \
16 silence 1 0 $silence_treshold 1 00:00:$silence_timeout $silence_treshold \
17 trim 0 $message_timeout
18 echo -e "====> DELAY\t$message_delay seconds"
19 sleep $message_delay
20 [ -n "$message_intro" ] && {
21 echo -e "====> TTS\t$message_intro"
22 which espeak && espeak -- "$message_intro"
23 }
24 echo -e "====> PLAYING\t$file, normalizing to $normalize_db dB"
25 play --norm=$normalize_db "$file"
26 done
27
28
This page took 0.346772 seconds and 4 git commands to generate.