title: ios 7 non deprecated solution to resuming background music from duck
body: <p>I am able to duck my background audio while playing new sounds. However I am unable to resume the background audio level to maximum again. When my delegate tries to "unduck" it just keeps being ducked. The normal fix for this is AudiosessionSetProperty, but that's deprecated in iOS 7 and Apple doesn't give any hints in the deprecation warnings or documentation. </p>
  
  <p>I call this method on load of view.</p>
  
  <pre><code>- (void) configureAVAudioSession
  {
      //get your app's audioSession singleton object
      AVAudioSession* session = [AVAudioSession sharedInstance];
  
      //error handling
      BOOL success;
      NSError* error;
  
  
       success=[session setCategory:AVAudioSessionCategoryPlayback
                   withOptions:AVAudioSessionCategoryOptionMixWithOthers error:&amp;error];
  
  
  
      if (!success)
      {
           NSLog(@"AVAudioSession error :%@",error);
  
      }
      else
      {
  
      }
      success = [session setActive:YES error:&amp;error];
  
      if (!success) {
          NSLog(@"Error setting active %@",error);
      }
      else
      {
          NSLog(@"succes settings active");
      }
  
  
  }
  </code></pre>
  
  <p>This is when I play audio</p>
  
  <pre><code>-(void)playTimeOnGo
  {
  
  
      NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle]
                                           pathForResource:@"just-like-magic"
                                           ofType:@"mp3"]];
      self.audioPlayer = [[AVAudioPlayer alloc]
                          initWithContentsOfURL:url
                          error:nil];
        self.audioPlayer.delegate=(id&lt;AVAudioPlayerDelegate&gt;)self;
  
      //get your app's audioSession singleton object
      AVAudioSession* session = [AVAudioSession sharedInstance];
  
      //error handling
      BOOL success;
      NSError* error;
  
  
      success=[session setCategory:AVAudioSessionCategoryPlayback
                       withOptions:AVAudioSessionCategoryOptionDuckOthers error:&amp;error];
  
      [self.audioPlayer prepareToPlay];
      [self.audioPlayer play];
  
  
      AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
  }
  </code></pre>
  
  <p>This is my delegate when audio is done to resume background audio and undock audio</p>
  
  <pre><code>- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)data successfully:(BOOL)flag{
  
      [self configureAVAudioSession];
  
      NSLog(@"playback ended");
  
  }
  </code></pre>
  
  <p>So how do I unduck the background music again without deprecated APIs? calling  <code>[self configureAVAudioSession];</code> apparently doesn't work....</p>