Question about calling SAPI from javascript.
Web Development
1
Posts
1
Posters
0
Views
1
Watching
-
Suppose now I have a webpage with following content.
How are you?
Question about calling SAPI from javascript. I came across a difficult problem. Could anybody help me? Thanks!
How do you do?
And I use the following script to interact with the speech engine. var VoiceObj = new ActiveXObject("Sapi.SpVoice"); VoiceObj.Speak(p2.innerText, SPF_ASYNC); //SPF_ASYNC == 2 What I want is to highlight the word which is currently being read by the speech engine. So it's a synchronization problem. I think I have to handle the Word event of the SpVoice object. So I wrote the following signature. But what code shall I put in this function? function VoiceObj::Word(Number, Position, CharacterPosition,Length) { } Very thanks! Jie