2

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?

cfischer
  • 24,452
  • 37
  • 131
  • 214

4 Answers4

3

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];
Community
  • 1
  • 1
Onato
  • 9,916
  • 5
  • 46
  • 54
3

Have a look a CMU's Flite TTS engine.

There are a few iOS ports of Flite, for example

d1jhoni1b
  • 7,497
  • 1
  • 51
  • 37
Paul Dixon
  • 4,201
  • 7
  • 28
  • 27
  • 1
    For those of you who have not learned the hard way, Flite is absolutely horrendous for quality (think old Windows, at the very best), and the number of files required to use it in any project makes for a prohibitively expensive build operation. (Analyzing the sample project generates 1 Warning and 33 Analyzer results. Not good.) It's free, but essentially worthless. – Thromordyn Jun 15 '11 at 14:03
  • 1
    I disagree that it is worthless - it depends whether you need high fidelity speech reproduction or not! My application uses Flite and is enhanced by the 80's style synthesis. – mikecsh Sep 04 '11 at 03:42
2

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.

edc1591
  • 10,146
  • 6
  • 40
  • 63
0

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.

Peter Zhou
  • 3,881
  • 2
  • 21
  • 19