--- In advanced_delphi@yahoogroups.com, "totallyfreeenergy" 
<totallyfreeene...@...> wrote:
>
> I have a tricky problem while using Microsoft TextToSpeech component.
> When I start the speak say
>  
> Form1.TextToSpeech1.Speak("After I stop speaking comp1 will become visible");
> Form1.Component1.Visible := true;
> 
> I would like to achieve a pause till the TextToSpeech1 stops speaking then go 
> to the next statement. 
> 
> If anyone has any ideas on this, pl. help !
> 
> Regards
> TFE
> http://totallyfreeenergy.zxq.net
>

Maybe I'm not fully understanding your inquiry but... Speak can be called 
synchronously or asynchronously. By default... it occurs synchronously.

To "ensure" that it occurs synchronously... use the SVSFDefault flag.
e.g. Form1.TextToSpeech1.Speak("This is a test.", SVSFDefault)
List of flags can be found at...
http://msdn.microsoft.com/en-us/library/ms720892(VS.85).aspx

Form1.Component1.Visible should not become visible until "after" Speak has 
spoken the text.

As a footnote... I'm using Delphi 7 on a WinXP SP3 system and the 
WaitUntilDone(INFINITE) works as it's suppose to if I use the SVSFlagsAsync 
flag.

I believe I mentioned this web site in a previous message related to SAPI (it 
contains good documentation, a .zip file with several examples, and several 
links to even more info regarding SAPI)...
http://www.blong.com/Conferences/DCon2002/Speech/SAPI51/SAPI51.htm

David


Reply via email to