Using google Text-To-Speech (TTS) API on iOS

三世轮回 提交于 2019-12-04 12:19:52

Google TTS limited to 100 characters.

So you should split-up your long sentence in to small 100 character chunks and pass it to the Google TTS method.

You can achieve this through implementing below steps.

  1. Split-up your long sentence in to small 100 character chunks.
  2. Call Google TTS with first split 100 character string.
  3. Play it using Google TTS & AVAudioPlayer
  4. Implement AVAudioPlayer audioPlayerDidFinishPlaying delegate .
  5. In that delegate, call Google TTS with second split 100 character string.
  6. Call the process recursively until reach the last character.

Here is my Google-TTS-Library-For-iOS library that I created for you :)

Google TTS is limited to 100 characters.

I recently created a lib that helped a lot with that problem. There are some improvements to be made, but please free to use it. GoogleTTSAPI

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!