首页 > 移动平台 > 详细

[iOS]AVSpeechSynthesizer语音合成

时间:2017-06-19 17:36:52      阅读:312      评论:0      收藏:0      [点我收藏+]
 1 #import <AVFoundation/AVFoundation.h>
 2 
 3 // 初始化方法
 4 AVSpeechSynthesizer *speech = [[AVSpeechSynthesizer alloc]init];
 5 
 6 // 设置内容
 7 AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:
 8                                 @"红鲤鱼与绿鲤鱼与驴"];
 9 // 设置语音类型
10 utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"zh-CN"];
11 
12 // 语速
13 utterance.rate = 0.5;
14 
15 // 开始朗读
16 [speech speakUtterance:utterance];

 

[iOS]AVSpeechSynthesizer语音合成

原文:http://www.cnblogs.com/EverNight/p/7049685.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!