Play Audio when device in silent mode - ios swift
<p>I am creating an application using xcode 7.1, swift. I want to play an audio. Everything is fine. Now my problem I want to hear sound when the device in silent mode or muted. How can I do it?</p>
<p>I am using the following code to play audio</p>
<pre><code>currentAudio!.stop()
currentAudio = try? AVAudioPlayer(contentsOfURL: NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource(&quot;sample_audio&quot;, ofType: &quot;mp3&quot;)!));
            
currentAudio!.currentTime = 0
currentAudio!.play();
</code></pre>