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...
- I开发者_运维百科 need "MixWithOthers" ON to use an AVAssetReader
- I need "MixWithOthers" OFF to use Audio Remote Controls
Does anyone know of how I can setup my AudioSession so I can use both?
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.
精彩评论