home *** CD-ROM | disk | FTP | other *** search
/ Sound Sensations! / sound_sensations.iso / voice / tpspeech / speech.pas < prev   
Pascal/Delphi Source File  |  1985-10-26  |  4KB  |  120 lines

  1. {
  2.  This is the Turbo Pascal include-file for the speech driver.  The
  3.  parameter S must be a character string containing valid phoneme codes:
  4.  
  5.    CODE   SOUND  (capitalized in sample word)
  6.    ----   -----
  7.     A     mAke   = m-A-k
  8.     AE    bAt    = b-AE-t
  9.     AH    cAr    = k-AH-r
  10.     AW    dOg    = d-AW-g
  11.     B     Bat    = B-ae-t
  12.     CH    CHeese = CH-ee-z
  13.     D     Dog    = D-aw-g
  14.     EE    bE     = b-EE
  15.     EH    bEt    = b-EH-t
  16.     F     raFt   = r-ae-F-t
  17.     G     Go     = G-oh
  18.     H     Hive   = H-i-v
  19.     I     tIme   = t-I-m
  20.     IH    sIt    = s-IH-t
  21.     J     Jet    = J-eh-t
  22.     K     Kill   = K-ih-l
  23.     L     Love   = L-uh-v
  24.     M     Map    = M-ae-p
  25.     N     Nab    = N-ae-b
  26.     OH    gO     = g-OH
  27.     OO    gOO    = g-OO
  28.     P     Pat    = P-ae-t
  29.     R     Rat    = R-ae-t
  30.     S     Sat    = S-ae-t
  31.     SH    SHe    = SH-ee
  32.     T     Tap    = T-ae-p
  33.     TH    THin   = TH-ih-n
  34.     TZ    THis   = TZ-ih-s
  35.     U     wOrd   = w-U-r-d
  36.     UH    bUt    = b-UH-t
  37.     V     Vat    = V-ae-t
  38.     W     With   = W-ih-th
  39.     WH    WHich  = WH-ih-ch
  40.     Y     Yes    = Y-eh-s
  41.     Z     Zap    = Z-ae-p
  42.     ZH    viSion = v-ih-ZH-eh-n
  43.     -     inter-phoneme separator
  44.    space  inter-word pause
  45. }
  46.  
  47. type
  48.   SpeechString = string[255];
  49.  
  50. procedure Speech(S: SpeechString);
  51.   external 'SPEECH.BIN';
  52.  
  53. { This procedure speaks the positive integers 1 through 32768. }
  54. procedure NumSpeech(N: integer);
  55.   begin
  56.     case N of
  57.       01:           Speech(' wh-uh-n');
  58.       02:           Speech(' t-oo');
  59.       03:           Speech(' th-r-ee');
  60.       04:           Speech(' f-oh-r');
  61.       05:           Speech(' f-i-v');
  62.       06:           Speech(' s-ih-k-s');
  63.       07:           Speech(' s-eh-v-eh-n');
  64.       08:           Speech(' a-ee-t');
  65.       09:           Speech(' n-i-n');
  66.       10:           Speech(' t-eh-n');
  67.       11:           Speech(' eh-l-eh-v-eh-n');
  68.       12:           Speech(' t-w-eh-l-v');
  69.       13:           Speech(' th-ih-r-t-ee-n');
  70.       14:           Speech(' f-oh-r-t-ee-n');
  71.       15:           Speech(' f-ih-f-t-ee-n');
  72.       16:           Speech(' s-ih-k-s-t-ee-n');
  73.       17:           Speech(' s-eh-v-eh-n-t-ee-n');
  74.       18:           Speech(' a-ee-t-t-ee-n');
  75.       19:           Speech(' n-i-n-t-ee-n');
  76.       20..29:       begin
  77.                       Speech(' t-w-eh-n-t-ee');
  78.                       NumSpeech(N - 20);
  79.                     end;
  80.       30..39:       begin
  81.                       Speech(' th-ih-r-t-ee');
  82.                       NumSpeech(N - 30);
  83.                     end;
  84.       40..49:       begin
  85.                       Speech(' f-oh-r-t-ee');
  86.                       NumSpeech(N - 40);
  87.                     end;
  88.       50..59:       begin
  89.                       Speech(' f-ih-f-t-ee');
  90.                       NumSpeech(N - 50);
  91.                     end;
  92.       60..69:       begin
  93.                       Speech(' s-ih-k-s-t-ee');
  94.                       NumSpeech(N - 60);
  95.                     end;
  96.       70..79:       begin
  97.                       Speech(' s-eh-v-eh-n-t-ee');
  98.                       NumSpeech(N - 70);
  99.                     end;
  100.       80..89:       begin
  101.                       Speech(' a-ee-t-ee');
  102.                       NumSpeech(N - 80);
  103.                     end;
  104.       90..99:       begin
  105.                       Speech(' n-i-n-t-ee');
  106.                       NumSpeech(N - 90);
  107.                     end;
  108.       100..999:     begin
  109.                       NumSpeech(N div 100);
  110.                       Speech(' h-uh-n-d-r-eh-d');
  111.                       NumSpeech(N mod 100);
  112.                     end;
  113.       1000..maxint: begin
  114.                       NumSpeech(N div 1000);
  115.                       Speech(' th-aw-u-s-ae-n-d');
  116.                       NumSpeech(N mod 1000);
  117.                     end;
  118.     end;
  119.   end {NumSpeech};
  120.