home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / t / talkpas.zip / TALK.PAS < prev    next >
Pascal/Delphi Source File  |  1989-04-23  |  3KB  |  102 lines

  1. {Talk is a speech program which uses phonemes to speak numbers through}
  2. {the PC's speaker port.}
  3.  
  4. {This program was derived from a program found in }
  5. {the IBMPRO forum library of Compuserve called TPSPCH.ARC }
  6. { Authors: David Neal Dubois,  Michael Day }
  7. { released by authors to the public domain as of 22 April 1989 }
  8.  
  9. program Talk;
  10. Uses Speech;
  11.  
  12. procedure NumSpeak(N: integer);
  13.   begin
  14.     case N of
  15.       01:           Speak(' wh-uh-n');
  16.       02:           Speak(' t-oo');
  17.       03:           Speak(' th-r-ee');
  18.       04:           Speak(' f-oh-r');
  19.       05:           Speak(' f-i-v');
  20.       06:           Speak(' s-ih-k-s');
  21.       07:           Speak(' s-eh-v-eh-n');
  22.       08:           Speak(' a-ee-t');
  23.       09:           Speak(' n-i-n');
  24.       10:           Speak(' t-eh-n');
  25.       11:           Speak(' eh-l-eh-v-eh-n');
  26.       12:           Speak(' t-w-eh-l-v');
  27.       13:           Speak(' th-ih-r-t-ee-n');
  28.       14:           Speak(' f-oh-r-t-ee-n');
  29.       15:           Speak(' f-ih-f-t-ee-n');
  30.       16:           Speak(' s-ih-k-s-t-ee-n');
  31.       17:           Speak(' s-eh-v-eh-n-t-ee-n');
  32.       18:           Speak(' a-ee-t-t-ee-n');
  33.       19:           Speak(' n-i-n-t-ee-n');
  34.       20..29:       begin
  35.                       Speak(' t-w-eh-n-t-ee');
  36.                       NumSpeak(N - 20);
  37.                     end;
  38.       30..39:       begin
  39.                       Speak(' th-ih-r-t-ee');
  40.                       NumSpeak(N - 30);
  41.                     end;
  42.       40..49:       begin
  43.                       Speak(' f-oh-r-t-ee');
  44.                       NumSpeak(N - 40);
  45.                     end;
  46.       50..59:       begin
  47.                       Speak(' f-ih-f-t-ee');
  48.                       NumSpeak(N - 50);
  49.                     end;
  50.       60..69:       begin
  51.                       Speak(' s-ih-k-s-t-ee');
  52.                       NumSpeak(N - 60);
  53.                     end;
  54.       70..79:       begin
  55.                       Speak(' s-eh-v-eh-n-t-ee');
  56.                       NumSpeak(N - 70);
  57.                     end;
  58.       80..89:       begin
  59.                       Speak(' a-ee-t-ee');
  60.                       NumSpeak(N - 80);
  61.                     end;
  62.       90..99:       begin
  63.                       Speak(' n-i-n-t-ee');
  64.                       NumSpeak(N - 90);
  65.                     end;
  66.       100..999:     begin
  67.                       NumSpeak(N div 100);
  68.                       Speak(' h-uh-n-d-r-eh-d');
  69.                       NumSpeak(N mod 100);
  70.                     end;
  71.       1000..maxint: begin
  72.                       NumSpeak(N div 1000);
  73.                       Speak(' th-aw-u-s-ae-n-d');
  74.                       NumSpeak(N mod 1000);
  75.                     end;
  76.     end;
  77.   end; {NumSpeak}
  78.  
  79. var
  80.   Value : integer;
  81.   I : word;
  82.  
  83. begin
  84.   Resolve := 1;
  85.   SpeedDelay := 22*Resolve;
  86.  
  87.   CalibrateSpeech(false);
  88.  
  89.   {for I := 0 to 15 do                   (* to speak your computer's memory *)
  90.     Talk ( ptr ( I * $1000, 0 ), 0 );}
  91.  
  92.   Value := 100;
  93.   while Value > 0 do
  94.   begin
  95.      write ( 'Enter value: ');
  96.      readln ( Value );
  97.      NumSpeak ( Value );
  98.      writeln;
  99.   end;
  100.  
  101. end.
  102.