If you look in the documents in the Audio Connections section, you will find several modes that you can configure to tell the system how your application plans to use audio. By default, AVAudioSessionCategorySoloAmbient used, which monitors the call / silent switch and screen lock.
In order for your application to ignore the ring / tick settings, you can try changing the category:
#import <AudioToolbox/AudioToolbox.h> AudioSessionInitialize (NULL, NULL, NULL, NULL); AudioSessionSetActive(true); UInt32 sessionCategory = kAudioSessionCategory_MediaPlayback; AudioSessionSetProperty (kAudioSessionProperty_AudioCategory, sizeof(sessionCategory),&sessionCategory);
If you want iPod audio to continue playing in the background, you'll also want to check out kAudioSessionProperty_OverrideCategoryMixWithOthers .
Ramin May 01 '10 at 9:41 a.m. 2010-05-01 09:41
source share