views:

122

answers:

3

Hi, I use Matt Galagher's AudioStreamer http://github.com/mattgallagher/AudioStreamer/ It works fine, however how to make in work at background on IPhone OS4?

+1  A: 

Check out this document, in particular:

Applications that play audio can continue playing that audio while in the background. To indicate that your application plays background audio, include the UIBackgroundModes key to its Info.plist file. The value for this key is an array containing the audio string. When this key is present, the system’s audio frameworks automatically prevent your application from being suspended when it moves to the background. Your application continues to run in the background as long as it is playing audio. However, if this key is not present when the application moves to the background, or if your application stops playing audio while in the background, your application is suspended.

You can use any of the system audio frameworks to initiate the playback of background audio and the process for using those frameworks is unchanged. Because your application is not suspended while playing audio, the audio callbacks operate normally while your application is in the background. While running in the background, your application should limit itself to doing only the work necessary to provide audio data for playback. Thus, a streaming audio application would download any new data from its server and push the current audio samples out for playback.

conmulligan
Thanks, it was very helpful.
Alexander Slabinskiy
A: 

Hi I tried the above solution Background modes but it still stops once the app is closed. Any ideas what is wrong?

George Syleos
A: 

Sorry my mistake everything works fine

George Syleos