55

Is there any way we can convert text to speech in an iPhone app? Is it possible using the SDK?

Jeffrey Bosboom
  • 13,313
  • 16
  • 79
  • 92
lostInTransit
  • 70,519
  • 61
  • 198
  • 274
  • check my answer http://stackoverflow.com/questions/12839671/text-to-speech-libraries-for-iphone/12839821#12839821 – Shamsudheen TK Apr 12 '13 at 02:34
  • 5
    Although still in beta iOS 7 is public now and includes the class `AVSpeechSynthesizer` that can be used for text-to-speech. [Reference](https://developer.apple.com/library/prerelease/ios/documentation/AVFoundation/Reference/AVSpeechSynthesizer_Ref/Reference/Reference.html#//apple_ref/doc/uid/TP40013447). – eliocs Sep 10 '13 at 07:54
  • 5
    voted for reopen, ios7 now is public. use the built in `AVSpeechSynthesizer` – AlexWien Sep 30 '13 at 20:22
  • Now possible. Look at my answer here: http://stackoverflow.com/a/20748015/292145 – Klaas Dec 23 '13 at 17:11

9 Answers9

30

The Flite speech synthesis engine can be run on an iPhone, ref http://artofsystems.blogspot.com/2009/02/speech-synthesis-on-iphone-with-flite.html

  • 4
    The github repository for the Flite speech engine can be found here: https://github.com/jeska/eyesfree_dev/tree/11982410b2d6f9dbc8cb2f191a54d07dbe819157/iphone-tts – memmons Feb 26 '11 at 17:54
18

I don't think iPhone SDK provides any TTS facility internally. You should use a third party TTS engine or write one yourself.

Mehrdad Afshari
  • 414,610
  • 91
  • 852
  • 789
  • 8
    Not true anymore. iOS 7 introduced AVSpeechSynthesizer. – Klaas Dec 23 '13 at 17:08
  • 1
    @Klaas Thanks for the comment! Seems like you're on top of the latest SDK. It'd be great if you could edit the old post with appropriate details (or post a new, updated, answer). – Mehrdad Afshari Dec 26 '13 at 05:54
  • 1
    see my previous comment to the question. I cannot post a new answer to this question, because it is closed. I posted a code example in this answer to a different question: http://stackoverflow.com/a/20748015/292145 – Klaas Dec 26 '13 at 18:01
17

OpenEars also does text-to-speech on the iPhone (note: I'm the developer).

Halle
  • 3,584
  • 1
  • 37
  • 53
  • I've found this to have a very nice documentation, specially for first adopters of Xcode, where they need to know how to link it as a library. Many thanks and kudos. – Ernani Joppert Nov 27 '11 at 05:29
12

I'm probably bumping a dead thread but the Flite text-to-speech engine worked wonders for me!

Hope it helps!

Peter Lang
  • 54,264
  • 27
  • 148
  • 161
willium
  • 2,048
  • 5
  • 25
  • 34
  • were you able to add new voices to the flite engine? how does the output sound compared to the built-in speech synthesizer API? – Crashalot Mar 06 '16 at 06:08
9

Here's another text to speech:

https://bitbucket.org/sfoster/iphone-tts/

You need to download it and install as an API then you can use it like that :

[fliteEngine speakText:@"Hi there"];                    // Make it talk
[fliteEngine setPitch:90.0 variance:50.0 speed:0.9];    // Change the voice properties
[fliteEngine setVoice:@"cmu_us_awb"];                   // Switch to a different voice
[fliteEngine stopTalking];                              // stop talking

Pretty easy to use once you installed it as an API correctly.

Farini
  • 923
  • 1
  • 18
  • 35
  • 1
    are you able to add custom voices to the engine? thanks for sharing! – Crashalot Mar 06 '16 at 06:15
  • good question. I don't think you can though. You'd have to dig deep into the engine I'm not even sure how one would approach this. – Farini Jul 19 '16 at 17:51
  • 1
    ok thanks anyway ... have you found any good open source code for voice conversion (as opposed to TTS)? – Crashalot Jul 19 '16 at 18:39
6

http://github.com/KingOfBrian/VocalKit

I wrote a wrapper around pocket sphinx and flite, you should be able to check it out pretty quickly.

Brian King
  • 2,834
  • 1
  • 27
  • 26
3

The Tomsoft engine is only slow with the custom voices. I'm not sure why. But if you remove the other voices and just the integrated basic KAL voice it will speak almost instanteously. Please send me an email using the contact form on my website if you need any help with this.

Tomsoft
  • 31
  • 1
2

for text to sound files I just found these will researching above files

http://www.ivona.com/online/editor.php

http://www.acapela-box.com/

IVONA also has IPhone SDK

http://www.ivona.com/developer.php

brian.clear
  • 5,277
  • 2
  • 41
  • 62
0

Hoya VoiceText is the original provider of the TTS engine. Most of the commercial companies in US create a wrapper around VocieText and resell it.

This was developed by Pentax (LG's spinoff - Korean) which got bought by Hoya (a huge Japanese firm).

Visit here to send a request for the TTS engine: http://voicetext.jp/blog/122.html

Use google translate for English website.

Hoya is based in Japan, but they own NeoSpeech, which is their US provider of the VoiceText Engine. Check out their website for demos.

Community
  • 1
  • 1
Gamma-Point
  • 1,514
  • 13
  • 14