zoukankan      html  css  js  c++  java
  • iOS 语音朗读

    //判断版本大于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];
        }

  • 相关阅读:
    从温设计模式
    php pdf转图片
    PHP 微服务集群搭建
    死磕nginx系列--nginx 限流配置
    分别
    一生悲哀
    三十男人的思考
    test markdown
    linux 系统内核空间与用户空间通信的实现与分析<转>
    ue4 SNew补遗
  • 原文地址:https://www.cnblogs.com/yujidewu/p/6187139.html
Copyright © 2011-2022 走看看