iPhone 5有3个麦克风。我可以改变我录制的那个吗? [英] The iPhone 5 has 3 mics. Can I change from which one I'm recording?

查看:715
本文介绍了iPhone 5有3个麦克风。我可以改变我录制的那个吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

iPhone 5有3个麦克风,根据其产品介绍:

The iPhone 5 has 3 microphones, according to its product presentation:

浏览iFixit和其他人的网站后,我现在知道底部的位置麦克风是,我已经确定了背面的一个,就在相机旁边。

After looking through the website of iFixit and others I now know where the bottom microphone is and I've identified the one on the back, right next to the camera.

前面应该有另一个,顶部,但我可以看不到,所以我认为它在耳机/接收器开口后面。 (这是正确的吗?)

There should be another one on the front, at the top, but I can't see it, so I assume it's behind the earpiece/receiver opening. (Is this correct?)

我想从两个不同的麦克风录制,而iPhone 5正躺在它背上。 (所以后置麦克风是不可能的。)

I would like to record from two different microphones while the iPhone 5 is lying on it's back. (So the rear mic is out of the question).

我的问题:

我有什么办法吗?可以同时和单独录制两个麦克风(即立体声,像一些Windows Phone 8 Lumia手机让你这样做)?如果没有,是否有一种方法可用于在麦克风之间切换,例如来自iPhone底部的第一条记录,然后执行一些代码切换到顶部的那条记录?

Is there some way I can record from both mics at the same time and separately (i.e. in stereo, like some Windows Phone 8 Lumia phones let you do it)? If not, is there a method that I can use to switch between the microphones, e.g. first record from the one at the bottom of the iPhone, then execute some code to switch to the one at the top?

您的建议将不胜感激。

推荐答案

// set up the audio session
NSError *error = nil;

AVAudioSession *audioSession = [AVAudioSession sharedInstance];
[audioSession setCategory:AVAudioSessionCategoryPlayAndRecord error:&error];
[audioSession setActive:YES error:&error];

if (error != nil) { NSLog(error); }


// all available inputs
NSArray* inputs = [audioSession availableInputs];

// Locate the port corresponding to the built-in microphone
for (AVAudioSessionPortDescription* port in inputs)
{
    if ([port.portType isEqualToString:AVAudioSessionPortBuiltInMic])
    {
        [self setBuiltInMicPort:port];
        break;
    }
}

// list all microphones
for (AVAudioSessionDataSourceDescription *micType in [audioSession inputDataSources]) {
    NSLog(@"%@ -- %@ -- %@ -- %@", micType.dataSourceID, micType.dataSourceName, micType.location, micType.orientation );

    if ([micType.orientation isEqualToString:@"Front"]) // or @"Back" or @"Bottom"
    {
        [micType setPreferredPolarPattern:AVAudioSessionPolarPatternOmnidirectional error:&error]; // optional
        [self.builtInMicPort setPreferredDataSource:micType error:&error];   
    }
}

这是如何选择不同内置的基本示例iPhone中的麦克风。请记住麦克风的数量不同:iPhone 5及更高版本有三个麦克风,前几代只有两个麦克风(没有后麦克风)。

This is basic example how to select different built-in microphones in the iPhone. Please keep in mind that the number of microphones differs: iPhone 5 and later has three microphones while previous generations have only two microphones (no back mic).

有关详细信息,请参阅 Apples Technical Q& A

For more information read Apples Technical Q&A.

这篇关于iPhone 5有3个麦克风。我可以改变我录制的那个吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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