#!/bin/sh
#
#   $Id: btmpg123,v 1.7 2003/04/29 12:46:24 kds Exp $
#

set -e

if [ "$#" -lt 2 ] ; then
	echo "usage: btmpg123 <bda> <file>"
	exit 1
fi

bda=$1
file=$2

#btctl audio on sync setting 0x40
mpg123 -s "$file" | sox -t raw -r 44100 -s -w -c 2 - -t raw -r 8000 -s -b -c 1 - | btctl play $bda -

