diff options
author | tv <tv@also> | 2010-04-26 16:34:51 +0200 |
---|---|---|
committer | tv <tv@also> | 2010-04-26 16:34:51 +0200 |
commit | 3bf6c7a90c6d9141d2a5701203ba2fabe41a5c68 (patch) | |
tree | 4d70b0e10f2b3cd782c8bc47710e2bab2e680859 | |
parent | db8d3910efdaf735fa51f012fb48b52e23f25c4c (diff) |
Added modules: espeak lang msg play wall zeit
-rwxr-xr-x | modules/espeak | 17 | ||||
-rwxr-xr-x | modules/lang | 22 | ||||
-rwxr-xr-x | modules/msg | 6 | ||||
-rwxr-xr-x | modules/play | 31 | ||||
-rwxr-xr-x | modules/wall | 9 | ||||
-rwxr-xr-x | modules/zeit | 15 |
6 files changed, 100 insertions, 0 deletions
diff --git a/modules/espeak b/modules/espeak new file mode 100755 index 00000000..34c61e42 --- /dev/null +++ b/modules/espeak @@ -0,0 +1,17 @@ +#! /bin/sh +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}" + echo pitch: $p + echo lang: $v + echo capital: $k + echo amplitude: $a + echo gap: $g + #echo "[31mespeak -p \"$pitch\" -v \"$lang\" \"$*\"[m" >&2 + espeak -a $a -k $k -p $p -v $v -g $g "$*" & +esac diff --git a/modules/lang b/modules/lang new file mode 100755 index 00000000..07b6802e --- /dev/null +++ b/modules/lang @@ -0,0 +1,22 @@ +#! /bin/sh + +case "$1" in + (--help) + echo "set language or list available languages" ;; + (list) + espeak --voices | sed -n '1!p' | awk '{\ + printf"[32m/lang %s [0;35mset [4mlang[0;35m to %s[m\n",$2,$4 + }' ;; + ('') + echo /set lang >$NOISE_linefeed ;; + (*) + if test -z "$2" ; then + echo /set lang "$1" + else + echo /set lang "$1" + shift + echo "$*" + echo /set lang "${noise_lang-de}" + fi >$NOISE_linefeed +esac + diff --git a/modules/msg b/modules/msg new file mode 100755 index 00000000..344dd963 --- /dev/null +++ b/modules/msg @@ -0,0 +1,6 @@ +#! /bin/sh +case "$1" in + (--help) : ;; + (*) + echo "$*" +esac diff --git a/modules/play b/modules/play new file mode 100755 index 00000000..ea5e991c --- /dev/null +++ b/modules/play @@ -0,0 +1,31 @@ +#! /bin/sh +case "$1" in + (--help) + echo "play an audio file" ;; + (*) + ffs='wav mp3 ogg asf flac' + + if test -z "$*" ; then + ls ~shack/speak/sample | sed -r ' + s:\.('"`echo "$ffs" | tr \ \|`"')$: [30m\1[m: + s:^:/play : + s:.*:[32m&[m: + ' + else + for i in $ffs ; do + f=~shack/speak/sample/$1.$i + test -f "$f" && + case "$i" in + wav) aplay "$f" & ;; + *) mplayer "$f" & ;; + esac && break + done || cat<<EOF +[33m\ +Keine Audiodatei mit dem Namen [4m$1[;33m.EXT gefunden... \ +am bessten gleich uploaden: +$ scp NAME shack@shack:speak/sample/ + +folgende Dateiendungen werden erkannt: $ffs[m +EOF + fi +esac diff --git a/modules/wall b/modules/wall new file mode 100755 index 00000000..fa7618fe --- /dev/null +++ b/modules/wall @@ -0,0 +1,9 @@ +#! /bin/sh +case "$1" in + (--help) : ;; + (?*) + for client in /tmp/noise-client-* ; do + #echo /msg "$*`printf '\a'`" >$client + echo /msg "$*" >$client + done +esac diff --git a/modules/zeit b/modules/zeit new file mode 100755 index 00000000..0b0537d3 --- /dev/null +++ b/modules/zeit @@ -0,0 +1,15 @@ +#! /bin/sh + +case "$1" in + (--help) + echo "say current time" ;; + (*) + exec >>$NOISE_linefeed + echo /set pitch 10 + case "$lang" in + (de|'') date +'"Es ist %k Uhr %M."' >$NOISE_linefeed ;; + (en|*-en) date +'"It is %k o clock and %M minutes"' >$NOISE_linefeed ;; + (*) echo "[31mError: unsupported [4mlang[0;31m = $lang[m" >&2 + esac + echo /set pitch ${noise_pitch-100} +esac 2>&1 |