#! /bin/sh
##
## vboxplay v@VERSION@ (@VERDATE@)

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

SAMPLE=$1
VOLUME=$2
if [ "$VOLUME" == "" ]; then
   VOLUME=5;
fi


   # 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="/usr/bin/play -t au -v $VOLUME -"

@BINDIR@/vboxmode $SAMPLE

case $? in

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

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