Audio for each word in a piece of text
In my iOS app, I have a paragraph of text. When a word is touched, I want to highlight the word and play audio for the word. I also want to play audio to read the entire paragraph, highlighting each word that is read.
The implementation that I have is
- to create audio file per word
- Maintain a dictionary of word to audio file and play the audio file when the word is touched.
- Concatenate the audio files for the words in the paragraph and play it to hear the entire paragraph. I dont know yet how to keep the highlighting of t开发者_如何学Che words in-sync with the audio
I need this app to work offline. I plan to record audio for the words myself.
Are there other, efficient ways of doing this? Thanks!
Another possible solution path would be to have a single audio file, and maintain an array of the time offset of each silence marker.
However, TTS would seem to be the obvious solution. How many words do you need to record? I created little utility that lets me record phrases to file by holding down the space bar speaking and releasing. so I can easily record thousands of files in this way. I can even feed in the required data and it will present each line for me to speak. get in touch with me if you need this...
精彩评论