#!/bin/sh
#
# Play wav files with wavplay otherwise play them with sox.
#
# March 13, 1997
#
# Karl O. Pinc
#
# (c) The Meme Factory, Inc.  1997  http://www.meme.com
# See accompaying GNU copyright notice.
#
# The sox play code sucked from "play" part of sox.11g, except I double
# quoted the argument so that it can play sounds in files that contain
# spaces.  (Like Win-95 vfat files.)

if file -L "$1" | grep -w "WAVE audio data" > /dev/null ; then
  exec wavplay -q "$1"
elif file -L "$1" | grep -w "Microsoft RIFF" > /dev/null ; then
  exec playmidi "$1"
else
  exec sox "$1" -t .au - > /dev/audio
fi

