Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 11-21-2011, 07:34 PM   #1 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 20
mnifield is on a distinguished road
Default AVAudioPlayer play Audio without multitasking when device is locked, PLEASE HELP

Hi I really need some help with this issue. Is it possible to play audio when a device is locked in foreground without using mutlitasking flag?


It used to work for me in iOS4 but since iOS5 this no longers functions, it requires me to have multitasking enabled to play audio when the device is locked.


[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:audioPath] error:NULL];
audioPlayer.delegate = self;
audioPlayer.pan = speakerBalance / 100;
audioPlayer.numberOfLoops = -1;
audioPlayer.currentTime = 0.0;
audioPlayer.volume = 1.0;
[audioPlayer play];


This code above worked great for me in iOS4 but no longer in iOS5, can someone please tell me if its even possible in iOS5 to have audio play when the device is locked in foreground without the mutlitasking flag enabled.


The reason i don't want the multitasking flag enabled is because this is a free app and the paid version has mulitasking, and if i add the multitasking flag and only have audio play when the device locks Apple reject my app.


I'm really stuck and getting annoyed with Apple's rejections because it seem to me that they removed the ability to use audio when locked without the flag.


The amusing part is the above app is an iPad app, i already have iPhone app that has the mutlitasking flag enabled while not allowing background audio but allowing device locked audio. They are both the same implementation except the Apple review team approved the iPhone but not the iPad version, how lame is that.


I love inconsistent app reviewing...


Thanks

Matt

Last edited by mnifield; 11-21-2011 at 11:51 PM.
mnifield is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 398
16 members and 382 guests
7twenty7, chiataytuday, Clouds, dedeys78, Duncan C, e2applets, EvilElf, iekei, ipodphone, jeroenkeij, leostc, mbadegree, Murphy, QuantumDoja, sacha1996, Sami Gh
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,125
Posts: 402,910
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:34 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0