summaryrefslogtreecommitdiffstats
path: root/noise/modules/play
diff options
context:
space:
mode:
authorFelix Richter <Felix.Richter@syntax-fehler.de>2011-05-29 15:48:47 +0200
committerFelix Richter <Felix.Richter@syntax-fehler.de>2011-05-29 15:48:47 +0200
commit590f55d10dd4ce2e00ecf422e38385d3c7bace29 (patch)
treea4e07d12b5763bd667438dce18ad092127ec4233 /noise/modules/play
parent427bdf4e2093217f967384f785e3907930a74a21 (diff)
parente0ec5d2e8560ae433ee677622b24ba82dbe7630b (diff)
Merge branch 'master' of github.com:krebscode/painload
Diffstat (limited to 'noise/modules/play')
-rwxr-xr-xnoise/modules/play36
1 files changed, 36 insertions, 0 deletions
diff --git a/noise/modules/play b/noise/modules/play
new file mode 100755
index 00000000..749b450a
--- /dev/null
+++ b/noise/modules/play
@@ -0,0 +1,36 @@
+#! /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 shack@shack.shack:noise/samples/
+
+folgende Dateiendungen werden erkannt: $ffs
+EOF
+ fi
+esac