iOS7 introduced the abiltiy for developers to do speech synthesizing. This means now you can translate text into speech.
It’s quite simple to do:
First import the AVFoundation framework – you may also need to link your project with it as well.
Now create an utterance and give it to a speech synthesizer instance:
NSString* textToSpeak = @"Look ma', no hands!"; AVSpeechUtterance* utterance = [[AVSpeechUtterance alloc] initWithString:textToSpeak]; AVSpeechSynthesizer* synthesizer = [[AVSpeechSynthesizer alloc] init]; [synthesizer speakUtterance:utterance];
For the most part that’s it. If you want to do some more advanced stuff, you can adjust the voice, speech rate, and get notifications of how far through speaking your synthesizer is.