AVCaptureDevice返回nil [英] AVCaptureDevice returning nil

查看:192
本文介绍了AVCaptureDevice返回nil的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里有一个问题,试图在OS X上获取任何捕获设备输入端口。专用于音频(例如内置麦克风)。这是我运行的代码。

I'm having an issue here trying to get any capture device input port on OS X. Specifically for audio (for example built in mic). Here's the code I'm running.

NSArray * devices = [AVCaptureDevice devices];
NSLog(@"devices = %li", devices.count);

它的输出总是0.现在如果我创建一个AVCaptureScreenInput端口,我可以管理得到工作,但我不能得到音频与它。最终目标是记录屏幕并同时捕获音频。问题是得到音频端口。

The output for that is always 0. Now if I create an AVCaptureScreenInput port I can manage to get that to work, but I can't get audio with it. The ultimate goal is to record the screen and also capture audio at the same time. The problem is getting the audio port.

推荐答案

我有多蠢。沙箱已启用,麦克风未选中。我希望我的愚蠢会帮助别人在这里。

How stupid of me. Sandboxing was on and Microphone was not checked. I hope my stupidity helps someone else here.

这篇关于AVCaptureDevice返回nil的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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