3 # convert recorded message to WAV format, optionally send it via mail
5 # by: Stefan Herrmann <stefan@asterix.webaffairs.net>
6 # Date: Fr 22 Mai 1998 14:18:40 CEST
8 # $FreeBSD: src/share/examples/isdn/contrib/convert.sh,v 1.1.2.1 2001/08/10 14:59:47 obrien Exp $
9 # $DragonFly: src/share/examples/isdn/contrib/convert.sh,v 1.3 2008/05/18 03:02:53 pavalos Exp $
13 SOX
=/usr
/local
/bin
/sox
14 ALAW2ULAW
=/usr
/local
/bin
/alaw2ulaw
17 ZIP
=/usr
/local
/bin
/zip
18 UUENCODE
=/usr
/bin
/uuencode
27 set -- `getopt i:o:m: $*`
31 echo 'Usage: r2w -i <input file> -o <outfile name>.wav -m <email address>'
64 if [ $iF -eq 0 -o $oF -eq 0 ]
66 echo 'Usage: r2w -i <input file> -o <outfile name>.wav -m <email address>'
70 if [ $iF -eq 1 -a $oF -eq 1 ]
73 echo "converting $inputfile to $outfilename.wav ..."
75 $CAT $inputfile |
$ALAW2ULAW |
$SOX -t raw
-U -b -r 8000 - -t .wav
$outfilename.wav
78 if [ $iF -eq 1 -a $oF -eq 1 -a $mF -eq 1 ]
80 echo "... and sending it via email to $mailto ..."
81 $UUENCODE $outfilename.wav message.wav |
$MAIL -s"new message $outfilename" $mailto && $RM $outfilename.wav
82 # only useful when sending over the internet
83 #$GZIP -c $outfilename.wav | $UUENCODE message.zip | $MAIL -s"Nachricht vom ISDN Anrufbeantworter" $mailto && $RM $outfilename.wav