Play AVAudioPlayer From A Sleeping iPhone
<p>I am creating a alarm application.
I am using Audio Session in my main delegate class.</p>

<pre><code>OSStatus result = AudioSessionInitialize(NULL, NULL, interruptionListenerCallback, self);
UInt32 category = kAudioSessionCategory_MediaPlayback;
result = AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(category), &amp;category);  

AudioSessionSetActive(YES);
</code></pre>

<p>I am using a separate class for audio playing.But i am not able to play audio when iPhone is sleeping.</p>

<p>could any one tell me how to use a audio session so that i can play audio file even when iPhone is sleeping.</p>

<p>Thank You</p>
