unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, speech, comobj,
activeX;
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;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
begin
VoiceText := CreateComObject(CLSID_VTxt)
as IVoiceText;
OleCheck(VoiceText.
Register(
nil, PChar(Application.ExeName),
nil, GUID_NULL, 0,
nil));
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
OleCheck(VoiceText.Speak(PChar(memText.Text), 0,
nil));
end;
end.