Вопрос

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top