//判断版本大于7.0
if ([[[UIDevice currentDevice] systemVersion] integerValue] >= 7.0) {
NSString * tempStr = @"朗读内容! ";
AVSpeechUtterance * utterance = [AVSpeechUtterance speechUtteranceWithString:[NSString stringWithFormat:@"话秋天气提醒您:%@", tempStr]];
//速率
utterance.rate = 0.15;
//设置语言
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"zh-CN"];
AVSpeechSynthesizer * synthesizer = [[AVSpeechSynthesizer alloc] init];
//获取当前系统语音 - 语音合成器会生成音频
[synthesizer speakUtterance:utterance];
}else {
UIAlertView * alertView = [[UIAlertView alloc] initWithTitle:@"温馨提示" message:@"当前系统不支持语音播报" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil];
[alertView show];
}
相关文章
- 04-13glViewport在Android和iOS中有不同的结果
- 04-13iOS应用千万级架构:安全与加密
- 04-13一种iOS抓取web页中的图片并显示方案
- 04-13基于React-Native0.55.4的语音识别项目全栈方案
- 04-13Unity WebView 插件⭐️(十三)特定模块 iOS网页视图—iOSWebViewWebView
- 04-13iOS贷款类APP被拒
- 04-13⑨(多媒体篇)、《史上最全iOS八股文面试题》2022年,金三银四我为你准备了,iOS《1000条》笔试题以及面试题(包含答案)。带面试你过关斩将,(赶紧过来背iOS八股文)
- 04-13IOS开发之常用第三方框架(完善中)
- 04-13【情感识别】基于神经网络的语音情感识别【Matlab 507期】
- 04-13基于matlab GUI BP神经网络0到9语音识别