summaryrefslogtreecommitdiffstats
path: root/modules/play
diff options
context:
space:
mode:
Diffstat (limited to 'modules/play')
-rwxr-xr-xmodules/play32
1 files changed, 32 insertions, 0 deletions
diff --git a/modules/play b/modules/play
new file mode 100755
index 00000000..dcb8749f
--- /dev/null
+++ b/modules/play
@@ -0,0 +1,32 @@
+#! /bin/sh
+case "$1" in
+ (--help)
+ echo "play an audio file" ;;
+ (*)
+ exec 2>&1
+ ffs='wav mp3 ogg asf flac'
+
+ if test -z "$*" ; then
+ ls $HOME/noise/samples | sed -r '
+ s:\.('"`echo "$ffs" | tr \ \|`"')$: \1:
+ s:^:/play :
+ s:.*:&:
+ '
+ else
+ for i in $ffs ; do
+ f=$HOME/noise/samples/$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 besten gleich uploaden:
+$ scp NAME $LOGNAME@shack:noise/samples/
+
+folgende Dateiendungen werden erkannt: $ffs
+EOF
+ fi
+esac