I have a large collection of wav files. About half of them I have to play
with mpg123 the other half play with any other player like esdplay, artsplay,
or sox/play. How annoying is that when you want to have licq use both types?
You can't. So I wrote a wrapper "jplay" that uses mp3info to verify which
type of wav file it's reading and use the appropriate player, I also addedd
support to detect and use the right wrapper (artsdsp, esddsp, or none).
Now I just have licq or my mail notification program use jplay to play wav
files and it plays both types perfectly...
Here's the script - feel free to include it in mandrake linux.
#!/bin/sh
############################################################
# a wrapper to play wav files correctly without having to #
# manually select between mpg123 player or regular wav #
# player such as esdplay or artsplay, etc... #
# #
############################################################
# By Jason Straight <[EMAIL PROTECTED]> #
# 2001-03-01 #
############################################################
# figure out how to play the file - this recognizes arts, esd, and dsp
# a few lines borrowed from Mandrake-Linux soundwrapper script
if [ `/sbin/pidof artsd` ] ; then
PLAYER="artsplay"
MP3PLAY="artsddsp mpg123"
else
if [ `/sbin/pidof esd` ]; then
PLAYER="esdplay"
MP3PLAY="esddsp mpg123"
else
PLAYER="play"
MP3PLAY="mpg123"
fi
fi
# figure out what type of wav file we have
info=`mp3info $1 2>&1 | awk '{print $3}'`
# this is how we identify files that won't play with a regular wav player
# if I missed anything here someone email me so I can fix up the script
mp3="single-ch"
# play it
if [ $info = $mp3 ]
then
$MP3PLAY $1 >/dev/null 2>&1
else
$PLAYER $1 >/dev/null 2>&1
fi
--
Jason Straight