1

I am working on streaming audio player application for iOS. currently i am experimenting with AudioQueue and AudioUnit for playback.

Both works fine in the normal condition. But I am facing an issue with AudioUnit version of app when it goes to sleep mode.

AudioUnit version of the application stopped the playback when application goes to sleep mode. Where as AudioQueue version of the application playing with out any issue during the sleep mode.

I have set "kAudioSessionCategory_MediaPlayback" session category for both cases. I assume this session category should continue the playback even in sleep mode.

I am not sure what i am missing here.

I want to add pan/effects features to my application, so i am trying with AudioUnit.

Any help is highly appreciated.

Pshemo
  • 122,468
  • 25
  • 185
  • 269
jpsasi
  • 1,905
  • 2
  • 18
  • 29

2 Answers2

1

Finally i have got the AudioUnit Implementation working. I have set the AudioSession category as "kAudioSessionCategory_MediaPlayback". As i am using AudioUnit for playback, i need to set "kAudioUnitProperty_MaximumFramesPerSlice" property to 4096. so it will continue the playback even in the device is in the sleep mode.

jpsasi
  • 1,905
  • 2
  • 18
  • 29
0

According to Apple's documentation on audio sessions, you should probably use kAudioSessionCategory_SoloAmbientSound instead. This will stop all sounds from other applications, but that's the price you pay for being able to keep playing when the device is locked.

Nik Reiman
  • 39,067
  • 29
  • 104
  • 160
  • Let me try with your suggestion. but when i use **"kAudioSessionCategory_MediaPlayback"** with AudioQueue,it worked fine even the device is in sleep/standby.but it did stop playing when i use it with AudioUnit. – jpsasi Apr 26 '11 at 14:40