Your IP : 216.73.216.48
| Current Path : /usr/X11R6/bin/X11/ |
|
|
| Current File : //usr/X11R6/bin/X11/audiosend |
#!/bin/sh -e
# Copyright (c) 1991 Bell Communications Research, Inc. (Bellcore)
#
# Permission to use, copy, modify, and distribute this material
# for any purpose and without fee is hereby granted, provided
# that the above copyright notice and this permission notice
# appear in all copies, and that the name of Bellcore not be
# used in advertising or publicity pertaining to this
# material without the specific, prior written permission
# of an authorized representative of Bellcore. BELLCORE
# MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY
# OF THIS MATERIAL FOR ANY PURPOSE. IT IS PROVIDED "AS IS",
# WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
# Conversion from C shell to Bourne shell by Z-Code Software Corp.
# Conversion Copyright (c) 1992 Z-Code Software Corp.
# Permission to use, copy, modify, and distribute this material
# for any purpose and without fee is hereby granted, provided
# that the above copyright notice and this permission notice
# appear in all copies, and that the name of Z-Code Software not
# be used in advertising or publicity pertaining to this
# material without the specific, prior written permission
# of an authorized representative of Z-Code. Z-CODE SOFTWARE
# MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY
# OF THIS MATERIAL FOR ANY PURPOSE. IT IS PROVIDED "AS IS",
# WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
# Brought into line with metamail 2.7 beta release Csh version
# Dave Shield February 1994
# This is to make metamail/showaudio do playback on the speaker, not the phone.
AUDIOSPEAKERFORCE=1 ; export AUDIOSPEAKERFORCE
if test -d /usr/sony
then
dev=/dev/sb0
else
dev=/dev/audio
fi
if test -f /usr/sbin/sendmail
then
MAILCOMMAND=/usr/sbin/sendmail
else
MAILCOMMAND=mail
fi
if test ! -z "${1:-}"
then
to=$1
else
echo -n "To: "
read to
fi
echo -n "Subject: "
read subject
echo -n "CC: "
read cc
record=1
while true
do
if test $record -eq 1
then
echo -n "Press RETURN when you are ready to start recording: "
read foo
fname=`tempfile -p metamail -m 600`
fnameraw=`tempfile -p metamail -m 600`
echo "To: $to" > $fname
echo "Subject: $subject" >> $fname
echo "CC: $cc" >> $fname
echo "MIME-Version: 1.0" >> $fname
echo "Content-Type: audio/basic" >> $fname
echo "Content-Transfer-Encoding: base64" >> $fname
echo "" >> $fname
trap "kill -9 $! > /dev/null 2>&1" HUP INT TERM
if test -z "RECORD_AUDIO"
then
(cat < $dev > $fnameraw) &
else
($RECORD_AUDIO > $fnameraw) &
fi
echo -n "press RETURN when you are done recording: "
read foo
echo One moment please...
sleep 1
echo -n Killing recording job...
kill -9 $! > /dev/null 2>&1
mimencode -b < $fnameraw >> $fname
rm $fnameraw
echo "" >> $fname
fi
record=0
echo ""
echo "What do you want to do?"
echo ""
echo "1 -- Send mail"
echo "2 -- Listen to recorded message"
echo "3 -- Replace with a new recording"
echo "4 -- Quit"
read which
case $which in
1) echo -n "Sending mail, please wait... "
$MAILCOMMAND $to $cc < $fname
if test $? -eq 0
then
echo Done.
rm $fname
exit 0
else
echo Mail delivery failed, draft is in $fname
fi ;;
2) metamail -d $fname ;;
3) record=1 ;;
4) exit 0 ;;
esac
done