#! /bin/sh
##
## vboxplay v2.0.0BETA4 ()

#----------------------------------------------------------------------------#
# Usage: vboxplay SAMPLENAME [ VOLUME ]                                      #
#----------------------------------------------------------------------------#

SAMPLE=$1
VOLUME=$2

   # Replace this with your own play command. You also can use the pvftools
   # (or some other) to convert and play the messages.

#DOPLAY="/usr/local/bin/auplay -audio localhost:0 -volume $VOLUME"
DOPLAY="sox -t au - -t ul /dev/audio"

/usr/bin/vboxmode $SAMPLE

case $? in

   2|3|4|6) /usr/bin/vboxtoau <$SAMPLE | $DOPLAY
            ;;
         *) echo "$0: unknown vbox message format!"
            ;;
esac

# Example with pvftools:
#
# vboxtoau <$SAMPLE | \
#           autopvf | \
#           pvfamp $VOLUME | \
#           pvfcut 0.20 | \
#           pvftoau 8000 | \
#           auplay
