In meiner App muss ich zwischen diesen 2 verschiedenen AudioUnits wechseln. Immer wenn ich von VPIO auf RemoteIO umschalte, sinkt mein Aufnahmevolumen. Ziemlich großer Rückgang. Keine Änderung der Wiedergabelautstärke. Jemand hat das erlebt?Aufnahme Volumenwechsel zwischen RemoteIO und VPIO
Hier ist der Code, wo ich den Schalter, der durch eine Routing-Änderung ausgelöst wird. (Ich bin mir nicht sicher, ob ich die Änderung richtig gemacht habe, also frage ich auch hier.)
Wie löse ich das Problem des Aufzeichnungsvolumens?
Danke, schätze jede Hilfe, die ich bekommen kann.
Pier.
- (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];
}
}
Hallo Rocky, das habe ich ausprobiert. Weil ich AUGraphNodeInfo (theGraph, remoteIONode, 0, & _remoteIOUnit) verwende; Um die RemoteIO-Instanz zu erhalten, scheint es, dass ich AudioComponentInstanceDispose nicht verwenden kann (es stürzt ab). Ich habe den Beitrag gelesen, über den du zu sprechen scheinst. Scheint nicht für mich zu arbeiten:/ – lppier