iphoneioscore-audioaudiounitaudiosession

AudioSession Settings for RemoteIO to play nice with iPod


As I previously found here.

If you start running an AVAssetReader while using a Remote I/O callback to play audio, starting the AVAssetReader will block the Remote I/O callback unless you allow iPod mixing with...

UInt32 audioCategory = kAudioSessionCategory_MediaPlayback;
AudioSessionSetProperty(kAudioSessionProperty_AudioCategory,sizeof(audioCategory),&audioCategory);

AudioSessionSetProperty(kAudioSessionProperty_OverrideCategoryMixWithOthers, sizeof (UInt32), &(UInt32) {1});

However I am finding that this prevents the use of Audio Remote Control calls as setup here.

So...

Does anyone know of how I can setup my AudioSession so I can use both?


Solution

  • This works now in iOS 5. The correct handling is to leave MixWithOthers OFF. The AVAssetReader will no longer stop the callbacks of your audio playback.