gpt4 book ai didi

ios - RemoteIO和VPIO录音音量下降切换

转载 作者:可可西里 更新时间:2023-11-01 03:08:36 28 4
gpt4 key购买 nike

在我的应用程序中,我需要在这 2 个不同的 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, 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];
}
}

最佳答案

我为此使用了我的苹果开发者支持。支持人员是这样说的:

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.

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

关于ios - RemoteIO和VPIO录音音量下降切换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13801297/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com