IOS 5/6: low volume after first use of CoreAudio

I am working on a VoIP application. AudioSession mode is set to kAudioSessionMode_VoiceChat.

To call, I open CoreAudio AudioUnit with a subtype of kAudioUnitSubType_VoiceProcessingIO. Everything is working fine. After the first call, I close AudioUnit with AudioUnitUninitialize (), and I deactivate the audio session.

Now, however, it seems that the audio device is incorrectly released: the ringer volume is very low, the volume of the media player is lower than usual. And for the subsequent call, I can no longer activate kAudioUnitSubType_VoiceProcessingIO. It works to create an AudioUnit with kAudioUnitSubType_RemoteIO, but also the call volume is very low (both the receiver and speaker).

This first happened on iOS 5. With the iPhone 5 on iOS 6, it's even worse (even lower volume).

Has anyone seen this? Do I need to do more than AudioUnitUninitialize () to free the speech processing module?

+7
source share
2 answers

I found a solution: I used AudioUnitUninitialize() incorrectly to free the audio component obtained with AudioComponentInstanceNew() . Use AudioComponentInstanceDispose() correctly.

+8
source

Yes, you need to disable the audio universe when using voiceProcessingIO. For some reason, there is no problem using the RemoteIO subtype. Therefore, whenever you get OSStatus -66635 (kAudioQueueErr_MultipleVoiceProcessors), check that there are no calls to AudioComponentInstanceDispose ().

+4
source

All Articles