title: AudioQueueStart returns 561015905 (AVAudioSessionErrorCodeCannotStartPlaying)
body: <p>My app uses Audio Queue Services to play sounds. On app start, I set audio session category to solo ambient:</p>
  
  <pre><code>`[[AVAudioSession sharedInstance] setCategory:AVAudioSEssionCategorySoloAmbient error:&amp;error];`
  </code></pre>
  
  <p>When my app delegate gets <code>applicationWillResignActive</code> notification, I call <code>AudioQueuePause(queue);</code> for all playing sounds. And when the app delegate gets <code>applicationDidBecomeActive</code>, I call</p>
  
  <pre><code>OSStatus status = AudioQueueStart(queue, 0);
  </code></pre>
  
  <p>Sometimes (and it's hard to reproduce) <code>status</code> equals to 561015905. This value does not belong to <a href="https://developer.apple.com/library/mac/documentation/MusicAudio/Reference/AudioQueueReference/#//apple_ref/doc/uid/TP40005117-CH5g-RCM0127" rel="nofollow">Audio Queue Result Codes</a>. It is <code>AVAudioSessionErrorCodeCannotStartPlaying</code>, and docs say</p>
  
  <blockquote>
    <p><em>"The app is not allowed to start recording and/or playing, usually because of a lack of audio key in         its Info.plist.  This could also
    happen if the app has this key but uses a category that can't record<br>
          and/or play in the background (AVAudioSessionCategoryAmbient,
    AVAudioSessionCategorySoloAmbient, etc.)."</em></p>
  </blockquote>
  
  <p>I definitely do not want to play the sound in background (that's why I am pausing audio queues when app resigns active). So, what am I doing wrong?</p>