summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rwxr-xr-xmodules/espeak17
-rwxr-xr-xmodules/lang22
-rwxr-xr-xmodules/msg6
-rwxr-xr-xmodules/play31
-rwxr-xr-xmodules/wall9
-rwxr-xr-xmodules/zeit15
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 "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<<EOF
+\
+Keine Audiodatei mit dem Namen $1.EXT gefunden... \
+am bessten gleich uploaden:
+$ scp NAME shack@shack:speak/sample/
+
+folgende Dateiendungen werden erkannt: $ffs
+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 "Error: unsupported lang = $lang" >&2
+ esac
+ echo /set pitch ${noise_pitch-100}
+esac 2>&1