开发者

Text Highlighting with the play back sound or voice

i have a requirement to highlight the text when the sound is played in the back ground as like toy story book but i don't have idea how to do it. Some body was telling that calculate the time of each word and do it but it is lengthy process because there are around 50 pages and for each page there is at least 100 words. for calculating the 100 word length and synchronize the animation with the voice is very typical task. Please if any body have some sam开发者_StackOverflow社区ple code then please share it. I am in the critical condition at this point i got stuck at this point of time. Please help me.


There are at least two ways for this task:

  1. Use CoreText to implement a custom UIView that display custom format for specific texts based on progress of readings.

  2. Use a UIWebView, populated with content of text, with each text wrapped within tag like <span>. Using JavaScript and CSS to dynamically change the format of the texts based on progress of readings.

Either way you dont need to mess with low level text sizing. You may also consider highlight the text by each paragraph rather than each words, if your requirement permit.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜