简体   繁体   English

一段文本中每个单词的音频

[英]Audio for each word in a piece of text

In my iOS app, I have a paragraph of text.在我的 iOS 应用程序中,我有一段文字。 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 the 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.然而,TTS 似乎是显而易见的解决方案。 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...有这个需要可以联系我...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM