I am trying to use iPhone OS 4.0\'s multitasking capability. I tried to play audio in the background with no luck. I added UIBackgroundModes property in info.plist and menti
It sounds like you didn't set up your Audio Session correctly. From http://developer.apple.com/iphone/library/documentation/AudioVideo/Conceptual/MultimediaPG/UsingAudio/UsingAudio.html :
For example, when using the default audio session, audio in your application stops when the Auto-Lock period times out and the screen locks. If you want to ensure that playback continues with the screen locked, include the following lines in your application’s initialization code:
NSError *setCategoryErr = nil;
NSError *activationErr = nil;
[[AVAudioSession sharedInstance] setCategory: AVAudioSessionCategoryPlayback error:&setCategoryErr];
[[AVAudioSession sharedInstance] setActive:YES error:&activationErr];
The AVAudioSessionCategoryPlayback category ensures that playback continues when the screen locks. Activating the audio session puts the specified category into effect.
HI,
I think this video helps u in solving ur problem... IN WWDC videos they have clearly explained how u can enable the back ground audio... http://developer.apple.com/videos/wwdc/2010/ to view or download these videos u need to have a apple account... and in that see Session 109-Adopting multitasking on iPhone OS, Part2... Hope this will help u..
~Raviraja