From 3bf6c7a90c6d9141d2a5701203ba2fabe41a5c68 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 26 Apr 2010 16:34:51 +0200 Subject: Added modules: espeak lang msg play wall zeit --- modules/espeak | 17 +++++++++++++++++ modules/lang | 22 ++++++++++++++++++++++ modules/msg | 6 ++++++ modules/play | 31 +++++++++++++++++++++++++++++++ modules/wall | 9 +++++++++ modules/zeit | 15 +++++++++++++++ 6 files changed, 100 insertions(+) create mode 100755 modules/espeak create mode 100755 modules/lang create mode 100755 modules/msg create mode 100755 modules/play create mode 100755 modules/wall create mode 100755 modules/zeit (limited to 'modules') 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 "espeak -p \"$pitch\" -v \"$lang\" \"$*\"" >&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"/lang %s set lang to %s\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 \ \|`"')$: \1: + s:^:/play : + s:.*:&: + ' + 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<$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 "Error: unsupported lang = $lang" >&2 + esac + echo /set pitch ${noise_pitch-100} +esac 2>&1 -- cgit v1.2.3