Thanks Steve. That's a very good link. I have tried a few inbuilt callbacks like isSpeaking. So far still unable to get it to work as it should. May be it is because I am doing it within the VCL thread and that too within a for loop. Although I dont know why that should matter. I have heard that SAPI 5.3 has a new function WaitUntilDone that I think would be so useful. However how to get the download of it. Unlike previous versions, this is part of platform SDKs. I am using Windows XP SP3.
Regards TFE http://totallyfreeenergy.zxq.net --- In advanced_delphi@yahoogroups.com, "Steve Davis" <st...@...> wrote: > > Sounds like you need to institute a callback. > > From msdn page http://msdn.microsoft.com/en-us/library/ms997568.aspx > > > > > Properties > > > Callback > > > This property specifies the name of a class module containing methods that > receive notifications from the voice-text automation object. The class > module must contain a SpeakingStarted method and a SpeakingDone method. > > Example: > > You have a class module called VTxtCallback, which contains the following > code: > > <javascript:CopyCode('ctl00_MTCS_main_ctl04_code');> > > Copy <javascript:CopyCode('ctl00_MTCS_main_ctl04_code');> Code > > Option Explicit > Function SpeakingStarted() > Debug.Print "Started" > End Function > Function SpeakingDone() > Debug.Print "Stopped" > End Function > > And somewhere in your initialization routine, you have the following: > > <javascript:CopyCode('ctl00_MTCS_main_ctl05_code');> > > Copy <javascript:CopyCode('ctl00_MTCS_main_ctl05_code');> Code > > Set oVoice = New VTxtAuto.VTxtAuto > oVoice.Register App.Title, App.EXEName > oVoice.Callback = "Speak2Me.VTxtCallback" > > This code will set up the callback routine in the VTxtAuto object to point > to your class module. > > > > Good luck, > > Steve >