AVSpeechSynthesizer *reader = [[AVSpeechSynthesizer alloc]init];
AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:self.wenZiLabel.text];
AVSpeechSynthesisVoice *voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"zh-TW"];
utterance.voice = voice;
[reader speakUtterance:utterance];
需要导入的库
AVFoundation.framework
#import <AVFoundation/AVSpeechSynthesis.h>