Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

We have a Delphi dll and we are using that dll in our c# application. We can able to import the methods and can able to use that, but struck with the event handlings.

Please check the below delphi code which we need to define and handle in c#.net:
The CALLBACK API prototipes:
Delphi
TSpeechEvent = procedure; procedure without parametrs
TPositionEvent = procedure(Position: dword); one dword parametr 
TEngineEvent = procedure(Number: integer; Name: string); two parametrs, with Delphi string
TErrorEvent = procedure(Text: string); One parametr with string (it is Delphi string) 




The regist API:
procedure RegistOnStart(CallbackAddr: TSpeechEvent);

When engine start speaking.
procedure RegistOnStop(CallbackAddr: TSpeechEvent);

When engine Stop, that means the engine fully speak all injected text and ready to read next part of text. This is one way to speak big text (read books how example).

Because if you send big part of text to engine they is slowdown system and thinking lot of more time, that is not good.
procedure RegistOnPosition(CallbackAddr: TPositionEvent);

Get the current speak position in text (chars from begin of last injected Speaking text)

Thanks in Advanced.
Posted
Updated 1-Nov-11 0:21am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900