diff options
Diffstat (limited to 'modules/play')
-rwxr-xr-x | modules/play | 31 |
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 \ \|`"')$: [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 |