こんな感じのスクリプトにしています。
jazz.sh
#!/bin/sh
if [ $# -eq 0 ]; then
echo "jazz.sh [wbgo|wwoz|wayo|sakura]"
exit 1
fi
while getopts bk option
do
case $option in
b)
BG="yes"
;;
k)
KI="yes"
;;
\?)
exit 1
esac
done
shift `expr "${OPTIND}" - 1`
if [ $# -ge 1 ]; then
case $@ in
"wbgo" )
ST="http://wbgo.streamguys.net/wbgo128"
SR="48000"
;;
"wwoz" )
ST="http://wwoz-sc.streamguys1.com/wwoz-hi.mp3"
SR="44100"
;;
"wayo" )
ST="http://streaming.wayofm.org/wayo-192"
SR="48000"
;;
"sakura" )
ST="http://kathy.torontocast.com:3330/stream"
SR="44100"
;;
* )
echo "station incorrect"
;;
esac
else
killall mpg123
fi
if [ -n "${ST}" ]; then
N=`awk '/default/{gsub("pcm","");gsub(":","");print $1}' /dev/sndstat`
sysctl dev.pcm.${N}.bitperfect=1 > /dev/null
sysctl dev.pcm.${N}.play.vchanrate=${SR} > /dev/null
if [ -n "${BG}" ]; then
/usr/local/bin/mpg123 --no-control --utf8 ${ST} > /tmp/jazz.log 2>&1 &
else
/usr/local/bin/mpg123 --utf8 ${ST}
fi
fi
sakuraは日本のJAZZステーションです。けっこういいですよ。