Membuat Komputer Berbicara (Dalam Tata Baca Bahasa English)

-->      -       Buatlah Form
-       Buatlah satu buah button dalam form
-       Buatlah satu buat memo dalam form
-        
unit Unit1;
interface
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Memo1: TMemo;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;
  SpVoice: Variant;

implementation
uses ComObj ;     

{$R *.dfm}

procedure TForm1.FormCreate(Sender: TObject);
begin
     SpVoice:= CreateOleObject('SAPI.SpVoice');
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
     SpVoice.Speak(memo1.Text);
end;

end.

0 Response to "Membuat Komputer Berbicara (Dalam Tata Baca Bahasa English)"

Post a Comment