AVAudioPlayer, Audio Session Categories and lock
<p>I'm using AVAudioPlayer to play sounds on a game. When the user locks the device, I pause the game (and send it to a resume view) and want all the sounds to stop playing.</p>

<p>However, since the resume view is the same I use when loading a saved game, that view triggers a sound using an AVAudioPlayer. When it does so with the screen locked, the sound is audible, even though I'm setting the audio session to kAudioSessionCategory_SoloAmbientSound.</p>

<p>Does anyone know how to stop all sounds even if <code>AVAudioPlayer play</code> is called?</p>

<p>I tried calling this method:</p>

<pre><code>AudioSessionSetActive(false)
</code></pre>

<p>but it didn't help.</p>

<p><strong>Update:</strong> I'm currently setting the volume to 0.0 when the device is locked, however, I wanted to know if there was a built-in way via AudioSessions, etc.</p>

<p>Thank you</p>
