sync text with audio

hi ... can anyone pls help me..i have a txt file and the audio file which reads the contents of the text to the user. now when the audio file is played the contents of the text should be displayed accordingly word by word on the text area.
I found the total words in the txt file( word count = 8)
I also found the duration of the audio file( duration = 4180 ms)
now i set a time interval i.e a sleep method to pause n display the text on the textarea according to the audio played.the value for the sleep() is set as a variable t= duration/word count. I tried this method, but it does not work well for some files. my requirement is to sync the text display with the audio. can anyone suggest me an efficient way to solve this...
thanks in advance...
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!