2

I have been trying to use AVSpeechSynthesizer to read text from UIWebView. The way I want to do it is:

  1. Using JS to get the top visible element on screen (i.e. p, h1, h2, h3 etc.)
  2. Splitting the element into an array of words using JS.
  3. One by one, each Word is highlighted(JS) and spoken using AVSpeechSynthesizer.

Now the problem is, since each word is spoken one at a time, it speaks very abruptly, like individual words and not a sentence. What I want is that if would make the entire element speak with AVSpeechSynthesizer and getting to know how for how long is being spoken so as to synchronise the highlighting or to somehow make individuals words being spoken right now maintain as a sentence.

Dennis
  • 2,119
  • 20
  • 29
Simulator
  • 156
  • 1
  • 11

1 Answers1

0

Take look at AVSpeechSynthesizer-Example which shows word by word sync in example.

halfer
  • 19,824
  • 17
  • 99
  • 186
Paresh Navadiya
  • 38,095
  • 11
  • 81
  • 132
  • it is helpful to some extent , however here UILabel is being used, whereas in my case I use UIWebView, so attributed string is really of no help here, but thanks for the headstart. – Simulator Apr 14 '15 at 11:44