Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SAPI assign method to onWord Event

Status
Not open for further replies.

majlumbo

Programmer
Jul 13, 2010
295
US
I've been playing with the text to speech - SAPI. I want to attach a method to the spVoice.onWord event, but cannot figure out how to assigned the defined spVoice1Word procedure to this event.

spVoice1Word is defined as

Code:
procedure TForm1.SpVoice1Word(ASender: TObject; StreamNumber: Integer;StreamPosition: OleVariant; CharacterPosition, Length: Integer);

I've been using
Code:
spVoice.OnWord := spVoiceWord;

and to unassign it when I'm finished
Code:
spVoice.OnWord := nil;

but it tells me that I don't have the correct number of parameters. I thought I just needed to point the event to the correct method, what am I doing wrong?
 
Code:
spVoice.OnWord := spVoice[b]1[/b]Word;

?

It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.
 
Thanks,
but the listing I provided does have atypo, I did use

spVoice.OnWord := spVoice1Word;

as you suggest

but it is this line that I get an error stating that not enough parameters are provided.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top