#!/bin/sh
# Shell script to play sound files to unix style sound devices.
# Should auto detect most supported systems and play the file for you.

echo "rec v1.0 - front end to Sox"

if [ "$1" = "" ] ; then
  echo "Usage: [ fopts ] outfile
  echo "fopts: -r rate -c channels -s/-u/-U/-A -b/-w/-l/-f/-d/-D -x
  exit
fi

arch=`uname -s`

echo "Send break (control-c) to end recording"

if [ "$arch" = "SunOS" ]; then
  sox  -t sunau /dev/audio $@
else
  if [ "$arch" = "Linux" ]; then
    sox -t ussdsp /dev/dsp $@
  fi
fi
