Page 1 of 1

how to wait the time of speak?

PostPosted: May 14th, 2009, 2:17 pm
by alexhaifa
Hello,

First of all I want to congratulate for the wonderful component named Office assistant.

I need a help how to make the code wait until the text dissapear, let me explain better:
As you can see in my code below, when I display the text/msg to user, I pass 3000 or 5000 as time,
but my code go on even when I have still my assistent displaying the message on the screen. I'd like my
code could go on after displaying the message. Is there any way to do this? Is there any option in component
to make the code wait until the message fulfill the time that I passed to go on?

Thanks

If RespCerta=RespDigit Then Begin
Helper.Play([aaCongratulate]);
Helper.Play(aaSpeak);
Helper.Speak('ParabĂ©ns! VocĂȘ acertou a resposta!',3000);
OcultaHelper.Interval := 3000;
HelperGravaResposta(True, 3, CodQ);
GravaGraficoHelper(3,1,CodQ);
End Else Begin
MSG := Format(MSG,[RespCerta]);
Helper.Play(aaSad);
Helper.Play(aaSpeak);
Helper.Speak(MSG,5000);

Helper.wa
OcultaHelper.Interval := 5000;
HelperGravaResposta(False, 3, CodQ);
GravaGraficoHelper(3,0,CodQ);
End;
Finally

Re: how to wait the time of speak?

PostPosted: May 15th, 2009, 3:44 pm
by Kambiz
Here is the simple (maybe not the best) way to wait for speak balloon to be disappeared.

Code: Select all
Assistant1.Speak('Hello World!', 2000);
while Assistant1.VisibleBalloon = bkSpeak do
  Application.ProcessMessages;
ShowMessage('Balloon Closed');