语音合成器(IOS7 后推出的,6没有)
speec h:讲话 synthesizer:合成器 utterance:表达
{
AVSpeechSynthesizer *_synthesizer;
}
1 导入<AVFoundation/AVFoundation.h>
2 实例化发生对象及朗读内容
AVSpeechUtterance *uttrance=[AVSpeechUtterance speechUtteranceWithString:@"fuck you!!!"];
//实例化语言
AVSpeechSynthesisVoice.voice=[AVSpeechSynthesisVoice voiceWithLanguage:@"zh_CN"];
utterance.voice=voice;、
3 实例化语音合成器
_synthesizer=[[AVSpeechSynthesizer alloc]init];
[_synthesizer speakUtterance:utterance];