home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / metamail / bin / audiocompose next >
Encoding:
Text File  |  1993-05-10  |  1.9 KB  |  75 lines

  1. #!/bin/csh -f
  2. # Copyright (c) 1991 Bell Communications Research, Inc. (Bellcore)
  3. # Permission to use, copy, modify, and distribute this material 
  4. # for any purpose and without fee is hereby granted, provided 
  5. # that the above copyright notice and this permission notice 
  6. # appear in all copies, and that the name of Bellcore not be 
  7. # used in advertising or publicity pertaining to this 
  8. # material without the specific, prior written permission 
  9. # of an authorized representative of Bellcore.  BELLCORE 
  10. # MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY 
  11. # OF THIS MATERIAL FOR ANY PURPOSE.  IT IS PROVIDED "AS IS", 
  12. # WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
  13. #
  14.  
  15. if (! $?METAMAIL_TMPDIR) then
  16.     set METAMAIL_TMPDIR=/tmp
  17. endif
  18.  
  19. # This is to make metamail/showaudio do playback on the speaker, not the phone.
  20. setenv AUDIOSPEAKERFORCE 1 
  21.  
  22. if (-d /usr/sony) then
  23.     set dev=/dev/sb0
  24. else
  25.     set dev=/dev/audio
  26. endif
  27.  
  28. set audiofile=$1
  29. if (-e $audiofile && ! -z $audiofile) goto whatnext
  30.  
  31. record:
  32. echo -n "Press RETURN when you are ready to start recording: "
  33. set foo = $<
  34.  
  35. # THIS IS UNBELIEVABLY GRUBBY
  36. onintr cleanup
  37. if (! $?RECORD_AUDIO) then
  38.     (/bin/cat < $dev > $audiofile) &
  39. else
  40.     ($RECORD_AUDIO > $audiofile) &
  41. endif
  42. jobs -l > ${METAMAIL_TMPDIR}/AUDCAT.$$
  43. set foo=`/bin/cat ${METAMAIL_TMPDIR}/AUDCAT.$$`
  44. /bin/rm ${METAMAIL_TMPDIR}/AUDCAT.$$
  45. set PID=$foo[2]
  46. echo -n "press RETURN when you are done recording: "
  47. set foo=$<
  48. echo One moment please...
  49. /bin/sleep 1
  50. echo -n Killing recording job...
  51. /bin/kill -9 $PID >& /dev/null
  52.  
  53. whatnext:
  54. echo ""
  55. echo "What do you want to do?"
  56. echo ""
  57. echo "1 -- Listen to recorded message"
  58. echo "2 -- Replace with a new recording"
  59. echo "3 -- All Done, Quit"
  60. set which = $<
  61.     switch ("$which")
  62.         case 1:
  63.           cat $audiofile > $dev
  64.           breaksw
  65.         case 2:
  66.           goto record
  67.         case 3:
  68.           exit
  69.     endsw
  70. goto whatnext
  71. exit 0
  72. cleanup:
  73. kill -9 $PID >& /dev/null
  74.