how can i start a song when app is in background mode
<p>I want to stop all playbacks by playing a empty audio file when my app is in background I tried following code but I was not played.</p>

<pre><code> -(void)stop{
[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
if(_viewController.checkIpod==0){
    AVAudioPlayer *playerA = [[AVAudioPlayer alloc]
               initWithContentsOfURL:[NSURL fileURLWithPath:
                                      [[NSBundle mainBundle] pathForResource:@"2sec" ofType:@"mp3"]]
               error:nil];


    [playerA play];
    //[player close];
    _viewController.onceClosed=1;
    NSLog(@"Oneclosed=1");
}
else{
    //[self.musicPlayer play];
    [_viewController.musicPlayer pause];
    [_viewController.playerA play]; 
    NSLog(@"closing and playing the sound");
}
</code></pre>

<p>}</p>

<p>I placed this code in beginBackgroundTaskWithExpirationHandler
Please help</p>
