ios5 /6:首次使用CoreAudio后体积小。

时间:2021-11-01 19:44:26

I work on a VoIP app. The AudioSession's mode is set to kAudioSessionMode_VoiceChat.

我在一个VoIP应用程序上工作。AudioSession的模式设置为kAudioSessionMode_VoiceChat。

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

对于一个调用,我用subtype kAudioUnitSubType_VoiceProcessingIO打开一个CoreAudio AudioUnit。一切工作正常。在第一次调用之后,我用AudioUnitUninitialize()关闭AudioUnit,然后关闭音频会话。

Now, however, it seems as if the audio device is not correctly released: the ringer volume is very low, the media player's volume is lower than usual. And for a subsequent call, I cannot activate kAudioUnitSubType_VoiceProcessingIO anymore. It works to create an AudioUnit with kAudioUnitSubType_RemoteIO instead, but also the call's volume is very low (both receiver and speaker).

但是现在,似乎音频设备没有被正确地释放:铃声音量很低,媒体播放器的音量比平时低。对于随后的调用,我不能激活kAudioUnitSubType_VoiceProcessingIO。它使用kAudioUnitSubType_RemoteIO创建一个AudioUnit,但是调用的音量非常低(接收方和扬声器)。

This first occured on iOS 5. With the iPhone 5 on iOS 6, it is even worse (even lower volume).

第一次出现在ios5上。而iPhone 5在iOS 6上的表现甚至更糟糕(甚至更低)。

Has anyone seen this? Do I need to do more than AudioUnitUninitialize() to release the Voice Processing unit?

有人见过吗?我是否需要做超过AudioUnitUninitialize()来释放语音处理单元?

2 个解决方案

#1


8  

I've found the solution: I've incorrectly used AudioUnitUninitialize() to free the audio component retrieved with AudioComponentInstanceNew(). Correct is to use AudioComponentInstanceDispose().

我找到了解决方案:我错误地使用AudioUnitUninitialize()来释放由AudioComponentInstanceNew()检索的音频组件。正确的方法是使用AudioComponentInstanceDispose()。

#2


4  

Yes, you need to dispose the audioUnit when using voiceProcessingIO. For some reason there is no problem when using RemoteIO subtype. So whenever you get OSStatus -66635 (kAudioQueueErr_MultipleVoiceProcessors), check for missing AudioComponentInstanceDispose() calls.

是的,您需要在使用voiceProcessingIO时处理audioUnit。由于某些原因,使用RemoteIO子类型时没有问题。因此,当您获得OSStatus -66635 (kaudioqueueerr_multiplevoiceprocessor)时,检查丢失的AudioComponentInstanceDispose()调用。

#1


8  

I've found the solution: I've incorrectly used AudioUnitUninitialize() to free the audio component retrieved with AudioComponentInstanceNew(). Correct is to use AudioComponentInstanceDispose().

我找到了解决方案:我错误地使用AudioUnitUninitialize()来释放由AudioComponentInstanceNew()检索的音频组件。正确的方法是使用AudioComponentInstanceDispose()。

#2


4  

Yes, you need to dispose the audioUnit when using voiceProcessingIO. For some reason there is no problem when using RemoteIO subtype. So whenever you get OSStatus -66635 (kAudioQueueErr_MultipleVoiceProcessors), check for missing AudioComponentInstanceDispose() calls.

是的,您需要在使用voiceProcessingIO时处理audioUnit。由于某些原因,使用RemoteIO子类型时没有问题。因此,当您获得OSStatus -66635 (kaudioqueueerr_multiplevoiceprocessor)时,检查丢失的AudioComponentInstanceDispose()调用。