-# play the sounds individually; playsound can handle multiple files, but
-# "play" doesn't want to on some systems.
-for i in $*; do $PLAYCMD $i >/dev/null 2>&1; done
+# play the sounds individually; some apps like playsound can handle multiple
+# files, but "/usr/bin/play" doesn't want to on some systems.
+for filename in $*; do
+ case "$filename" in
+ *wav)
+ $BASIC_PLAY_CMD $filename >/dev/null 2>&1;
+ ;;
+ *mp3)
+ $MP3_PLAY_CMD $filename >/dev/null 2>&1;
+ ;;
+ *)
+ echo "I don't know the file extension here: $filename"
+ ;;
+ esac
+done