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.