lpp*_*ier 9 core-audio ios remoteio
在我的应用程序中,我需要在这两个不同的AudioUnit之间切换.每当我从VPIO切换到RemoteIO时,我的录音音量就会下降.相当大幅下降.尽管播放音量没有变化.有人经历过这个吗?
这是我进行切换的代码,由路由更改触发.(我不太确定我是否正确改变了,所以我也在这里问.)
如何解决录音音量下降的问题?
谢谢,感谢我能得到的任何帮助.
码头.
- (void)switchInputBoxTo : (OSType) inputBoxSubType
{
OSStatus result;
if (!remoteIONode) return; // NULL check
// Get info about current output node
AudioComponentDescription outputACD;
AudioUnit currentOutputUnit;
AUGraphNodeInfo(theGraph, remoteIONode, &outputACD, ¤tOutputUnit);
if (outputACD.componentSubType != inputBoxSubType)
{
AUGraphStop(theGraph);
AUGraphUninitialize(theGraph);
result = AUGraphDisconnectNodeInput(theGraph, remoteIONode, 0);
NSCAssert (result == noErr, @"Unable to disconnect the nodes in the audio processing graph. Error code: %d '%.4s'", (int) result, (const char *)&result);
AUGraphRemoveNode(theGraph, remoteIONode);
// Re-init as other type
outputACD.componentSubType = inputBoxSubType;
// Add the RemoteIO unit node to the graph
result = AUGraphAddNode (theGraph, &outputACD, &remoteIONode);
NSCAssert (result == noErr, @"Unable to add the replacement IO unit to the audio processing graph. Error code: %d '%.4s'", (int) result, (const char *)&result);
result = AUGraphConnectNodeInput(theGraph, mixerNode, 0, remoteIONode, 0);
// Obtain a reference to the I/O unit from its node
result = AUGraphNodeInfo (theGraph, remoteIONode, 0, &_remoteIOUnit);
NSCAssert (result == noErr, @"Unable to obtain a reference to the I/O unit. Error code: %d '%.4s'", (int) result, (const char *)&result);
//result = AudioUnitUninitialize(_remoteIOUnit);
[self setupRemoteIOTest]; // reinit all that remoteIO/voiceProcessing stuff
[self configureAndStartAudioProcessingGraph:theGraph];
}
}
Run Code Online (Sandbox Code Playgroud)
我使用了我的苹果开发者支持.这是支持说的:
语音I/O的存在将导致输入/输出的处理方式非常不同.我们并不期望这些单位具有相同的增益水平,但是水平不应该大幅下降,因为您似乎表明了这一点.
也就是说,Core Audio工程表明您的结果可能与创建语音块的时间有关,它也影响RIO实例.经过进一步的讨论,Core Audio工程人员认为,既然你说级别差异非常大,那么如果你可以提交某些录音的错误以突出你在语音I/O之间听到的级别差异会更好.远程I/O以及您的测试代码,因此我们可以尝试在内部重现并查看这是否确实是一个错误.最好包括上面概述的单个IO单元测试的结果以及进一步的比较结果.
没有控制此增益级别的API,所有内容都由操作系统在内部设置,具体取决于音频会话类别(例如,VPIO应始终与PlayAndRecord一起使用)以及已设置的IO单元.通常,不期望两者同时实例化.
结论?我认为这是一个错误.:/