通过iOS,麦克风访问以通过代码进行录音 [英] Access to microphone for recording via code, iOS

查看:572
本文介绍了通过iOS,麦克风访问以通过代码进行录音的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我正在使用AVAudioRecorder进行录制.录制没有问题.当我第一次玩我的应用程序时,问题是弹出一个关于允许/禁用允许使用麦克风的警报视图.

In my App am using AVAudioRecorder for recording. There is no problem regarding the recording. When I play my app for the first time, the problem is that an alertview pop ups, regarding allow/dis allow the microphone to be used.

我想拥有

1)控制此默认警报视图,以便仅当我单击允许"麦克风时,我的录音和计时器(用于显示秒,已录制音频的标签)才会开始

1) control over this default alertview, so that my recording and timer (a label that is used to show the seconds, audio recorded) starts only when I click on Allow microphone,

OR

2)需要设置该应用程序可用的麦克风,以便它不会提示Alertview要求允许/禁止允许麦克风.

2) need to set microphones available for the app, so that It doesn't prompt the alertview asking to allow/dis allow microphone.

我搜索了Internet,stackoverflow,但是没有得到与此帖子相关的任何信息. 阅读了一些帖子,但它们与显示状态有关,即麦克风是否适用于应用程序,这对我而言并没有太大用处.

I searched internet, stackoverflow, but didnt get any thing related to this post. Read some posts, but they were regarding displaying the status, that microphone is available for app or not, which is not of that much use for me.

推荐答案

正如约翰在评论中所提到的,该应用程序默认情况是要求使用麦克风的权限,并且无法更改.但是,您可以检查是否已授予许可.

As John mentioned in the comments it is default behaviour for the app to ask for permission to use the microphone and this cannot be changed. However you can however check to see if permission has been granted.

您可能应该仔细看一下这个问题,因为它说明了如何检查并查看是否已授予使用麦克风的权限.授予权限后,您就可以开始录制了.

You should probably have a look through this question as it explains how to check and see if access has been granted to use the microphone. You can then start your recording once permission has been granted.

检测麦克风权限

这篇关于通过iOS,麦克风访问以通过代码进行录音的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆