ios – 录制RemoteIO和VPIO之间的音量降低切换

在我的应用程序中,我需要在这两个不同的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,&currentOutputUnit);

if (outputACD.componentSubType != inputBoxSubType)
{
    AUGraphStop(theGraph);
    AUGraphUninitialize(theGraph); 
    result = AUGraphdisconnectNodeInput(theGraph,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,&remoteIONode);
    NSCAssert (result == noErr,@"Unable to add the replacement IO unit to the audio processing graph. Error code: %d '%.4s'",(const char *)&result);

    result = AUGraphConnectNodeInput(theGraph,mixerNode,0);
    // Obtain a reference to the I/O unit from its node
    result = AUGraphNodeInfo (theGraph,&_remoteIoUnit);
    NSCAssert (result == noErr,@"Unable to obtain a reference to the I/O unit. Error code: %d '%.4s'",(const char *)&result);

    //result = AudioUnitUninitialize(_remoteIoUnit);

    [self setupRemoteIOTest]; // reinit all that remoteIO/voiceProcessing stuff
    [self configureAndStartAudioProcessingGraph:theGraph];
}  
}

解决方法

我使用了我的苹果开发者支持.
这是支持说的:

The presence of the Voice I/O will result in the input/output being processed very differently. We don’t expect these units to have the same gain levels at all,but the levels shouldn’t be drastically off as it seems you indicate.

That said,Core Audio engineering indicated that your results may be related to when the voice block is created it is is also affecting the RIO instance. Upon further discussion,Core Audio engineering it was felt that since you say the level difference is very drastic it therefore it would be good if you Could file a bug with some recordings to highlight the level difference that you are hearing between voice I/O and remote I/O along with your test code so we can attempt to reproduce in house and see if this is indeed a bug. It would be a good idea to include the results of the singe IO unit tests outlined above as well as further comparative results.

There is no API that controls this gain level,everything is internally setup by the OS depending on Audio Session Category (for example VPIO is expected to be used with PlayAndRecord always) and which IO unit has been setup. Generally it is not expected that both will be instantiated simultaneously.

结论?我认为这是一个错误. :/

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...