我正在编写使用kAudioUnitSubType_VoiceProcessingIO
音频单元记录声音的应用程序。而且我想捕捉几天的奇怪错误。创建VPIO单元的新实例后,整个系统会自动更改内部麦克风增益。
初始化代码:
AudioComponentDescription audioComponentDescriptionWildcard =
{
kAudioUnitType_Output,
kAudioUnitSubType_VoiceProcessingIO,
kAudioUnitManufacturer_Apple
};
AudioComponent audioComponent =
AudioComponentFindNext(NULL,
&audioComponentDescriptionWildcard);
OSStatus status = AudioComponentInstanceNew(audioComponent, &audioComponentInstance);
验证问题的最简单方法是在AudioComponentInstanceNew
调用上进行断点,然后开始Skype Call至Skype Test Call Service。在执行记录的声音之前,声音很大。执行这条线后,麦克风级别会急剧下降。
与其他单位一样,一切都是正常的。App不会干扰其他记录应用程序。
这是因为默认情况下启用了自动增益控制。您需要将KauvoIceioproperty_voiceProcessingEnableAgc属性更改为0。