home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / source / simplesp.pit / simplespeech source.pit / chat.c next >
Encoding:
C/C++ Source or Header  |  1985-08-15  |  838 b   |  45 lines

  1. /*
  2.     Speech utility - useful for a verbose about╔ box.
  3.     Must have the Macintalk driver on the boot disk for this to run.
  4. */
  5.  
  6. #include <speech.h>
  7. #include <mem.h>
  8. #include <chat.h>
  9.  
  10. #define BUFFSIZE 4000L    /* arbitrary */
  11. extern speechhandle thespeech;
  12.  
  13.  
  14. int chat(string,mode,pitch,rate,chatstat)
  15. char string[];
  16. int mode;
  17. int pitch;
  18. int rate;
  19. int chatstat;
  20. {
  21.     handle output;
  22.     short i;
  23.     long strlength;
  24.     speecherr sperr;
  25.  
  26.     if (chatstat == FIRST_CALL)
  27.     {
  28.         sperr = speechon("",&thespeech);
  29.     }
  30.     strlength = (long) strlen(string);
  31.     speechpitch(thespeech,pitch,mode);
  32.     speechrate(thespeech,rate);
  33.     output = (handle)newhandle(0L);
  34.     sperr = reader(thespeech,string,strlength,output);
  35.     if (strlength < 1) 
  36.         return(0);
  37.     sperr = macintalk(thespeech,output);
  38.     disposhandle(output);
  39.     if (chatstat == LAST_CALL)
  40.     {
  41.         sperr = speechoff(thespeech);
  42.     }
  43. }
  44.  
  45.