Index » Empathy Jukebox : Blob de4c95 / olespeech.pas
unit olespeech;

interface
procedure speak (text : string; speed : integer; flags : integer );
function initspeech : integer;
procedure killspeech;

const
vtxsp_STATEMENT = 1;
vtxsp_QUESTION = 2;
vtxtst_COMMAND =4;
vtxtst_WARNING = 8;
vtxtst_READING = 16;
vtxtst_NUMBERS = 32;
vtxtst_SPREADSHEET = 64;
vtxtst_VERYHIGH = 128;
vtxtst_HIGH = 256;
vtxtst_NORMAL = 512;

implementation
uses ComObj;

var
VTxt : Variant;
APIexists : boolean;



function initspeech : integer;
begin
ApiExists:=true;

try
  VTxt := CreateOLEObject('Speech.VoiceText');
  VTxt.Register('', 'Empathy');
except  begin
result:=1;
APIExists:=false;
exit;
end;
end;
result:=0;
end;


procedure speak (text : string; speed : integer; flags : integer );


//PRORITY


begin
if apiexists=true then begin
VTxt.Enabled:=true;
VTxt.Speed:=speed;
VTxt.Speak(text,flags);
end;
end;

procedure killspeech;
begin
//if apiexists=true then if VTxt.IsSpeaking then VTxt.stopspeaking;
end;



end.