#import <AVFoundation/AVFoundation.h>

// 初始化方法
AVSpeechSynthesizer *speech = [[AVSpeechSynthesizer alloc]init];

// 设置内容
AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:
                                @"红鲤鱼与绿鲤鱼与驴"];
// 设置语音类型
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"zh-CN"];

// 语速
utterance.rate = 0.5;

// 开始朗读
[speech speakUtterance:utterance];

 

内容来源于网络如有侵权请私信删除
你还没有登录,请先登录注册
  • 还没有人评论,欢迎说说您的想法!