Question

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.

Was it helpful?

Solution

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.

OTHER TIPS

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.

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];

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.

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

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

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.

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

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

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.

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 :)

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top