Text to Speech on iOS

2019-03-11 13:01发布

I'd like to add text to speech on the iOS, but noticed that NSSpeechSynthesizer seems to be missing from Cocoa-Touch.

Are there any third party, commercial or FOSS, libraries that you would recommend? Will Apple reject an app that contains a third party library?

4条回答
走好不送
3楼-- · 2019-03-11 13:29

How to programmatically use iOS voice synthesizers? (text to speech)

Starting from iOS 7 Apple provides the following API...

https://developer.apple.com/library/ios/documentation/AVFoundation/Reference/AVSpeechSynthesizer_Ref/Reference/Reference.html

#import <AVFoundation/AVFoundation.h>
…
AVSpeechUtterance *utterance = [AVSpeechUtterance 
                            speechUtteranceWithString:@"Hello world"];
AVSpeechSynthesizer *synth = [[AVSpeechSynthesizer alloc] init];
[synth speakUtterance:utterance];
查看更多
Summer. ? 凉城
4楼-- · 2019-03-11 13:33

If you are not releasing your app on the App store, I recommend VoiceService API. It is a private API. But it is easy to use and outputs high quality sounds.

查看更多
对你真心纯属浪费
5楼-- · 2019-03-11 13:39

I've heard that OpenEars is good, but I don't really know too much about it. As for Apple accepting an app with third-party libraries, it all depends on whether or not the third-party library uses private frameworks or not. I'm sure that information is available on the OpenEars website.

查看更多
登录 后发表回答