From e4270049e4e0cefa1d3784d4215a23e53fe5e929 Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Sun, 13 Jan 2008 20:42:15 +0100 Subject: [PATCH 1/1] search for available audioplayer --- res/micropolis.tcl | 2 +- res/sounds/player | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100755 res/sounds/player diff --git a/res/micropolis.tcl b/res/micropolis.tcl index ff1ad9b..7b65a4c 100644 --- a/res/micropolis.tcl +++ b/res/micropolis.tcl @@ -942,7 +942,7 @@ proc EchoPlaySound {soundspec} { if {$Sound} { echo PlaySound [lindex $soundspec 0] signal ignore SIGCHLD - exec play res/sounds/[string tolower [lindex $soundspec 0]].wav & + exec res/sounds/player res/sounds/[string tolower [lindex $soundspec 0]].wav & } } diff --git a/res/sounds/player b/res/sounds/player new file mode 100755 index 0000000..7784940 --- /dev/null +++ b/res/sounds/player @@ -0,0 +1,13 @@ +#!/bin/sh + +PLAYER=true + +if [ -x "`which aplay`" ]; then + PLAYER=aplay +elif [ -x "`which play`" ]; then + PLAYER=play +elif [ -x "`which mplayer`" ]; then + PLAYER="mplayer -nogui -nocache" +fi + +exec ${PLAYER} "$@" >/dev/null 2>&1 -- 2.39.5