summaryrefslogtreecommitdiffstats
path: root/modules/espeak
diff options
context:
space:
mode:
authortv <root@telnet.shack>2010-12-28 21:43:42 +0100
committertv <root@telnet.shack>2010-12-28 21:48:06 +0100
commit2fe9176beab260f09f75a75513d10f295b353aee (patch)
treed722b1f7e6d7234a05607f710c3ec82413c4f5ce /modules/espeak
parent5e0e70d0e4138c89709f29f39b46e293dc31a68b (diff)
added -v and -d to /espeak
-v|--verbose: print arguments -d|--debug: print settings caveat: currently they cannot be used together
Diffstat (limited to 'modules/espeak')
-rwxr-xr-xmodules/espeak30
1 files changed, 20 insertions, 10 deletions
diff --git a/modules/espeak b/modules/espeak
index 4aad90b9..eeb93c0a 100755
--- a/modules/espeak
+++ b/modules/espeak
@@ -4,21 +4,31 @@ print_var() {
echo "$1 = $2"
}
-case "$1" in
- (--help) echo say something with espeak ;;
- (*)
- p="${noise_pitch-100}"
- v="${noise_lang-de}"
- k="${noise_capital-0}"
- a="${noise_amplitude-100}"
- g="${noise_gap-1}"
+speak() {
+ p="${noise_pitch-100}"
+ v="${noise_lang-de}"
+ k="${noise_capital-0}"
+ a="${noise_amplitude-100}"
+ g="${noise_gap-1}"
+ if test "$debug" = true; then
print_var pitch $p
print_var lang $v
print_var capital $k
print_var amplitude $a
print_var gap $g
- #echo "espeak -p \"$pitch\" -v \"$lang\" \"$*\"" >&2
- (espeak --stdout -a $a -k $k -p $p -v $v -g $g | paplay)<<EOF
+ fi
+ if test "$verbose" = true; then
+ echo "espeak: $@"
+ fi
+ #echo "espeak -p \"$pitch\" -v \"$lang\" \"$*\"" >&2
+ (espeak --stdout -a $a -k $k -p $p -v $v -g $g | paplay)<<EOF
$*
EOF
+}
+
+case "$1" in
+ (--help) echo say something with espeak ;;
+ (-d|--debug) shift; debug=true speak "$@";;
+ (-v|--verbose) shift; verbose=true speak "$@";;
+ (*) speak "$@";;
esac