Using iOS 7 text to speech
| |iOS 7 provides powerful text to speech (TTS) support. Here is a simple example:
NSString *language = @"zh-HK"; // set language, zh-HK will speak cantonese
NSString *string = @"你好嗎";
AVSpeechSynthesizer *synthesizer = [[AVSpeechSynthesizer alloc]init];
AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:string];
utterance.rate = AVSpeechUtteranceDefaultSpeechRate;
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:language];
[synthesizer speakUtterance:utterance];