使用iphone 5的后置麦克风 [英] use rear microphone of iphone 5

查看:225
本文介绍了使用iphone 5的后置麦克风的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我过去常常关注代码。 / o来自麦克风的音频。我想要做的是选择后置麦克风进行录制。我已经读过将kAudioSessionProperty_Mode设置为kAudioSessionMode_VideoRecording可以完成工作,但我不知道如何在我的代码中使用它。任何人都可以帮我成功设置这个参数。

I have used to following code the stream the i/o of audio from microphone. What I want to do is want to select the rear microphone for recording. I have read that setting kAudioSessionProperty_Mode to kAudioSessionMode_VideoRecording can do the work but I am not sure how to use this with my code. Can any one help me in successfully setting this parameter.

我有这些行来设置属性


status = AudioUnitSetProperty(audioUnit,
                              kAudioSessionProperty_Mode,
                              kAudioSessionMode_VideoRecording,
                              kOutputBus,
                              &audioFormat,
                              sizeof(audioFormat));
checkStatus(status);


但不起作用。

推荐答案

点击此处

您可以看到具体方法

struct AudioChannelLayout {
   AudioChannelLayoutTag     mChannelLayoutTag;
   UInt32                    mChannelBitmap;
   UInt32                    mNumberChannelDescriptions;
   AudioChannelDescription   mChannelDescriptions[1];
};
typedef struct AudioChannelLayout AudioChannelLayout;

您可以将AudioChannelDescription更改为2以使用辅助麦克风

you can change AudioChannelDescription to 2 for using secondary microphone

这篇关于使用iphone 5的后置麦克风的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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