32

I was wondering if iPhone has any API that supports Text to Speech feature? I looked around but couldn't find any, so just want to confirm.

Thanking in anticipation.

Mustafa
  • 20,504
  • 42
  • 146
  • 209

13 Answers13

29

I ran into this problem at one point, and got Flite (festival lite) text to speech engine running on iPhone. I recently made an API class for it. I tried to make it easy (and free) to add to new and existing projects. It can be downloaded at here.

Sam Foster
  • 406
  • 4
  • 4
  • It works great with small text to speak. do u know anything which would work for even large chunks of data like reading a whole document... – Arpit Raniwala Dec 25 '12 at 10:48
  • This works great, but the voices are very "robotic". They made some new high quality voices, http://www.cstr.ed.ac.uk/projects/festival/onlinedemo.html. I suppose you used the diphone voices. How did you convert these to .c files? – WYS Apr 30 '13 at 13:55
  • Do I understand it correctly from the licence, that the project can also be used in commercial applications? – syntagma May 04 '13 at 18:05
  • This library buggy and very slow on devices (long delay before hearing speech). It is probably not the answer you are looking for. – Undistraction Jun 25 '13 at 16:53
  • How many language does it support? – quangkid Mar 28 '18 at 08:32
11

The iPhone 3G S has the private VoiceServices framework which can do this. Steve Troughton-Smith describes how to use the private class VSSpeechSynthesizer here, but you have little chance of getting something using this into the App Store.

Brad Larson
  • 170,088
  • 45
  • 397
  • 571
  • Ah... What i was looking for. But not very useful if its use is so limited, and doubtful (w.r.t. App Store acceptance) :( Thanks. – Mustafa Jul 11 '09 at 10:29
7

For iOS 5 or 6 - nothing built-in. You need to use a third party library.

For iOS 7 there is a AVSpeechSynthesizer API.

Here's a simple example:

AVSpeechUtterance *utterance = [AVSpeechUtterance 
                                speechUtteranceWithString:@"Hello world"];
AVSpeechSynthesizer *synth = [[AVSpeechSynthesizer alloc] init];
[synth speakUtterance:utterance];
karim
  • 15,408
  • 7
  • 58
  • 96
5

OpenEars is an open-source iOS library for implementing round-trip English language speech recognition and text-to-speech on the iPhone and iPad, which uses the CMU Pocketsphinx, CMU Flite, and MITLM libraries.

Jagat Dave
  • 1,643
  • 3
  • 23
  • 30
Mustafa
  • 20,504
  • 42
  • 146
  • 209
3

I found this but i haven't tried it yet.

Jagat Dave
  • 1,643
  • 3
  • 23
  • 30
Bushra Shahid
  • 3,579
  • 1
  • 27
  • 37
2

The API docs would suggest that the API is not available.

teabot
  • 15,358
  • 11
  • 64
  • 79
2

You might also want to have a look at this.

It uses Flite. It doesn't contain specific instructions but it can give you ideas.

Jagat Dave
  • 1,643
  • 3
  • 23
  • 30
Dimitris
  • 13,480
  • 17
  • 74
  • 94
  • I tried to test it out once, but there was a web of compiler errors, and after 2 hrs, i gave up :) – Mustafa Oct 22 '09 at 10:15
1

For iOS 5 or 6 - nothing built-in. You need to use a third party library.

For iOS 7 there is a AVSpeechSynthesizer API.

Source Code also available in Github

Refer the Below Link

Jagat Dave
  • 1,643
  • 3
  • 23
  • 30
Prithivi
  • 101
  • 7
0

This is possible, but you will have to roll your own. I have seen an app do this.

John Ballinger
  • 7,380
  • 5
  • 41
  • 51
0

you can try to use google tts:

http://translate.google.com/translate_tts?tl=en&q=hello

and some others:

http://www.ispeech.org/api

http://tts-api.com/

TONy.W
  • 1,948
  • 19
  • 10
0

I did this before iPhone 2.0 came out by porting espeak to the platform. I used it as a command line utility but it should be possible to make it into a library.

Epsilon Prime
  • 4,576
  • 5
  • 31
  • 34
0

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.

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

Here is best One for me Google-TTS-Library-For-iOS library try it :)

A R
  • 461
  • 4
  • 14
-2

There's an Iphone app that does direct TTS, Search for "TTSMessenger" on Itunes

Jakes
  • 1