home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_02_03 / 2n03060a < prev    next >
Text File  |  1990-12-02  |  2KB  |  58 lines

  1. 10 '******************************************************************
  2. 20 'Speech demo - demonstrate ASCII text to synthesized speech
  3. 30 '              synthesis using the COVOX Sound Master and its
  4. 40 '              supporting programs SPEECHV2 and STALK.
  5. 50 '*****************************************************************
  6. 60 '
  7. 70 'Initialize variables
  8. 75 DEFINT T
  9. 76 DEFINT V
  10. 77 DEFINT P
  11. 78 DEFINT S
  12. 80 PROG.NAME$ = "STALK.EXE"
  13. 90 ENGLISH$ = "Hello there.  What would you like me to say?"
  14. 100 COVOX.INIT = 0
  15. 110 SET.SPEECH = 6
  16. 120 SPEAK = 3
  17. 130 TONE = 1
  18. 140 VOLUME = 9
  19. 150 PITCH = 5
  20. 160 SPEED = 5
  21. 170 '
  22. 180 'Set the DEF SEG value for the COVOX TSR software
  23. 190 '
  24. 200 CLS: PRINT: PRINT "One moment please . . . "
  25. 210 ' Search vectors 64 through 127 for the COVOX program address
  26. 220 FOR VECTOR = (64 * 4) TO (127 * 4) STEP 4
  27. 230     DEF SEG = 0: 'So we can access the vector table
  28. 240     'Get the segment and offset values for the vector
  29. 250     TEMP! = 256 * PEEK (VECTOR + 1)
  30. 260     OUR.OFFSET = PEEK (VECTOR + 0) + TEMP!
  31. 270     OUR.SEGMENT = PEEK (VECTOR + 2) + (256 * PEEK (VECTOR + 3))
  32. 280     '
  33. 290     ' If the value for the segment is not valid, look at the next vector
  34. 300     IF OUR.SEGMENT = 0 OR OUR.SEGMENT > 65024! THEN 410
  35. 310     '
  36. 320     'A segment value was found.  Look for program name.
  37. 330     DEF SEG = OUR.SEGMENT
  38. 340     PROG.FOUND = 1
  39. 350     FOR C = 0 TO LEN (PROG.NAME$) -1
  40. 360             IF PEEK (OUR.OFFSET + C) <> ASC(MID$(PROG.NAME$,C+1,1)) THEN PROG.FOUND = 0
  41. 370     NEXT C
  42. 380     '
  43. 390     ' This is the correct vector, so continue
  44. 400     IF PROG.FOUND = 1 THEN 460
  45. 410 NEXT VECTOR
  46. 420 PRINT:PRINT:PRINT PROG.NAME$; " has not been installed in memory."
  47. 430 PRINT "You must exit BASIC and load "; PROG.NAME$; " from the DOS prompt."
  48. 440 PRINT "Then RUN this program again."
  49. 450 END
  50. 460 CALL COVOX.INIT
  51. 470 CALL SET.SPEECH (TONE, VOLUME, PITCH, SPEED)
  52. 480 CALL SPEAK (ENGLISH$)
  53. 490 CLS: PRINT "Type an English word or sentence and press RETURN"
  54. 500 PRINT "Type 'Q' and press RETURN to exit."
  55. 510 LINE INPUT ">"; ENGLISH$: IF ENGLISH$ = "Q" THEN 530
  56. 520 GOTO 480
  57. 530 END
  58.