내 앱에서이 두 가지 AudioUnits 사이를 전환해야합니다. VPIO에서 RemoteIO로 전환 할 때마다 내 녹음 음량이 떨어집니다. 꽤 큰 하락. 재생 볼륨에 변화가 없습니다.이 경험이있는 사람이 있습니까?RemoteIO와 VPIO 간의 녹음 볼륨 드롭 전환
다음은 라우팅 변경에 의해 트리거되는 스위치를 수행하는 코드입니다. (나는 정확하게 변경했는지 여부를 확신 할 수 없으므로 여기에서도 묻습니다.)
녹음 볼륨 감소 문제를 어떻게 해결할 수 있습니까?
감사합니다. 얻을 수있는 도움에 감사드립니다.
부두.
- (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];
}
}
안녕하세요, 나는 그것을 시도했습니다. AUGraphNodeInfo (theGraph, remoteIONode, 0, & _remoteIOUnit)를 사용하기 때문에; remoteIO 인스턴스를 얻으려면 AudioComponentInstanceDispose (충돌)를 사용할 수없는 것 같습니다. 나는 당신이 말하는 것처럼 보이는 글을 읽었습니다. 나를 위해 작동하지 않는 것 같아요/ – lppier