iOS录音相关

iOS录音相关,第1张

权限判断

 AVAuthorizationStatus microPhoneStatus = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeAudio];
    switch (microPhoneStatus) {
        case AVAuthorizationStatusDenied:
        case AVAuthorizationStatusRestricted:
        {
            // 被拒绝
            [self goMicroPhoneSet];
        }
            break;
        case AVAuthorizationStatusNotDetermined:
        {
            // 没d窗
           AVAudioSession *avSession = [AVAudioSession sharedInstance];
                       
                       if ([avSession respondsToSelector:@selector(requestRecordPermission:)]) {
                           
                           [avSession requestRecordPermission:^(BOOL available) {
                               
                           }];
                       }
        }
            break;
        case AVAuthorizationStatusAuthorized:
        {
            // 有授权
        }
            break;

        default:
            break;
    }

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/996542.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-21
下一篇 2022-05-21

发表评论

登录后才能评论

评论列表(0条)

保存