How can I let ipod playback continue when my app is on the run?
Asked
Active
Viewed 300 times
2 Answers
4
At startup you need to init an AudioSession
by calling
AudioSessionInitialize(NULL,NULL,NULL,NULL);
and then set your audio category to kAudioSessionCategory_AmbientSound
, like so
UInt32 sessionCategory = kAudioSessionCategory_AmbientSound;
AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(sessionCategory), &sessionCategory);
AudioSessionSetActive(true);

Rhythmic Fistman
- 34,352
- 5
- 87
- 159
-
I thank you for showing concern but can you be a little more specific of what to do... i'm sort of a newbie..... i'll be thankful – valiantb Jul 10 '09 at 04:00
-
sure, I added a link to some code. – Rhythmic Fistman Jul 10 '09 at 07:25
-
looks like there's an errant space in "kAudioSessionProperty_AudioCategory" - but otherwise this worked great, even while doing remoteio and avaudioplayer at the same time. – Glenn Barnett Mar 24 '10 at 03:47
-
Fixed, happy to be of service. – Rhythmic Fistman Mar 30 '10 at 22:18
1
I'm pretty sure that it has nothing to do with your app (i.e. a special background service runs for the ipod), but i could be wrong...

RCIX
- 38,647
- 50
- 150
- 207