unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls,COMOBJ;

type
  TForm1 = class(TForm)
    Button1: TButton;
    Edit1: TEdit;
    StaticText1: TStaticText;
    StaticText2: TStaticText;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}
procedure SpeakText(text: String);
var
  voice: OLEVariant;
begin
  voice := CreateOLEObject('SAPI.SpVoice');
  voice.Speak(text);
end;



procedure TForm1.Button1Click(Sender: TObject);
begin
SpeakText(Edit1.Text);
end;

end.
