summaryrefslogtreecommitdiffstats
path: root/modules/play
diff options
context:
space:
mode:
authortv <tv@also>2010-04-26 16:34:51 +0200
committertv <tv@also>2010-04-26 16:34:51 +0200
commit3bf6c7a90c6d9141d2a5701203ba2fabe41a5c68 (patch)
tree4d70b0e10f2b3cd782c8bc47710e2bab2e680859 /modules/play
parentdb8d3910efdaf735fa51f012fb48b52e23f25c4c (diff)
Added modules: espeak lang msg play wall zeit
Diffstat (limited to 'modules/play')
-rwxr-xr-xmodules/play31
1 files changed, 31 insertions, 0 deletions
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