Search code examples
iphoneobjective-ctexttext-to-speechspeech

Text to speech in objective-c iPhone


I am developing an application in which I have to play string as an audio.

I am using http://translate.google.com/translate_tts?tl=en&q=Hello API to speak the string but it is a little bit slow.

Is there any library in objective-c to play string as an audio "Text To Speech".


Solution

  • Look at the classes AVSpeechUtterance and AVSpeechSynthesizer in io7. Basically you can just do the following.

         AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:text];
         AVSpeechSynthesizer *syn = [[[AVSpeechSynthesizer alloc] init]autorelease];
        [syn speakUtterance:utterance];