uses Comobj;
function speak(txt: string): boolean;
var
ov: OLEVariant;
begin
try
ov := CreateOLEObject('SAPI.SpVoice');
ov.Speak(txt, 0);
except
result := false;
exit;
end;
result := true;
end;
procedure TForm1.Button5Click(Sender: TObject);
begin
if not
Speak('That makes fun.')
then showmessage('Fehler');
end;