xcode 向 iOS 应用程序添加文本转语音功能

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14194170/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 02:28:31  来源:igfitidea点击:

Adding text to speech functionality to iOS app

iosxcodetext-to-speech

提问by AppsDev

I'd like to implement such functionality in my app, and AFAIK, the only choice is to use a third-party library, so I've been looking for possible options. I've found that OpenEars seems to be one of the best free and open-source libraries for that purpose, and it works offline, but it only supports English language and I'd want to offer multilanguage text to speech, at least for English, Portuguese, Spanish and French.

我想在我的应用程序和 AFAIK 中实现这样的功能,唯一的选择是使用第三方库,所以我一直在寻找可能的选择。我发现 OpenEars 似乎是为此目的最好的免费和开源库之一,它可以离线工作,但它只支持英语,我想提供多语言文本到语音,至少是英语、葡萄牙语、西班牙语和法语。

I've read that, for multilanguage support, Google TTS performs well, but it only works online... and I'm not sure if a limit of calls exists, does it? Where could I find detailed info about using Google TTS in iOS?

我已经读过,对于多语言支持,Google TTS 表现良好,但它只能在线工作......而且我不确定是否存在调用限制,是吗?在哪里可以找到有关在 iOS 中使用 Google TTS 的详细信息?

And finally, I've also read a lot of references to Flite or Festival Lite... but it doesn't seem to support multilanguage either. Does somebody know a free, open-source TTS library for iOS that supports several languages and, preferably, works offline?

最后,我还阅读了很多关于 Flite 或 Festival Lite 的参考资料……但它似乎也不支持多语言。有人知道适用于 iOS 的免费开源 TTS 库,它支持多种语言,并且最好可以离线工作吗?

Just another question. The app I'm working on may have a commercial version and it is intended to be submitted to the Apple Store. Could the use of any TTS third-party library be a problem?

只是另一个问题。我正在开发的应用程序可能有商业版本,打算提交给 Apple Store。使用任何 TTS 第三方库会不会有问题?

Thanks a lot

非常感谢

回答by rounak

iOS 7 has AVSpeechSynthesizerthat can do text-to-speech out-of-the-box without the need of any external frameworks.

iOS 7AVSpeechSynthesizer可以在不需要任何外部框架的情况下开箱即用地进行文本到语音转换。

For more on this, visit this link.

有关这方面的更多信息,请访问此链接

回答by Midhun MP

There is two API's which supports these languages:

有两个 API 支持这些语言:

  1. ispeech
  2. acapela
  1. 演讲
  2. 阿卡佩拉

But both are online and paid.

但两者都是在线和付费的

OpenEarsis a offline text-to-speech and speech-to-text opensource library. But I don't know whether it supports other languages other than English.

OpenEars是一个离线文本到语音和语音到文本的开源库。但我不知道它是否支持英语以外的其他语言。

Could the use of any TTS third-party library be a problem?Answer: No, there is no problem with this.

使用任何 TTS 第三方库会不会有问题?答:不,这没有问题。

Update (on 27 Aug 2013):
OpenEars now supports Spanish as well as English. (Check the below comment from Halle)

更新(2013 年 8 月 27 日):
OpenEars 现在支持西班牙语和英语。(查看哈雷的以下评论)