X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/micropolis/blobdiff_plain/e4270049e4e0cefa1d3784d4215a23e53fe5e929..146092b843bf23e3af1e62235355524f9c2a97f3:/res/sounds/player

diff --git a/res/sounds/player b/res/sounds/player
index 7784940..48e05d7 100755
--- a/res/sounds/player
+++ b/res/sounds/player
@@ -1,13 +1,25 @@
-#!/bin/sh
+#!/bin/bash
 
-PLAYER=true
+PLAYER=
 
-if [ -x "`which aplay`" ]; then
+if type -a aplay &>/dev/null; then
 	PLAYER=aplay
-elif [ -x "`which play`" ]; then
+elif type -a afplay &>/dev/null; then
+	#afplay is shipped with OS X Leopard
+	PLAYER=afplay
+elif type -a play &>/dev/null; then
 	PLAYER=play
-elif [ -x "`which mplayer`" ]; then
+elif type -a mplayer &>/dev/null; then
 	PLAYER="mplayer -nogui -nocache"
 fi
 
-exec ${PLAYER} "$@" >/dev/null 2>&1
+if [ "x${PLAYER}" = "x" ]; then
+	echo "Can't find audio player!"
+	echo "Please make sure you have aplay, play or mplayer in your path."
+	if [ "`uname`" = "Darwin" ]; then
+		echo "A working play for OS X is available from:"
+		echo "http://www.hieper.nl/html/play.html"
+	fi
+else
+	exec ${PLAYER} "$@" >/dev/null 2>&1
+fi