Swift - AVAudioPlayer not playing sound
<p>I have a sound called <code>speeding.mp3</code> and I am trying to make a AVAudioPayer instance with it by doing this in the root of the class:</p>

<pre><code>let speedingAudioPlayer = try! AVAudioPlayer(contentsOfURL: NSBundle.mainBundle().URLForResource("speeding", withExtension: "mp3")!)
</code></pre>

<p>Then when I run the app it throws an error but I don't know why this is happening. The <code>speeding.mp3</code> file is in the Bundle Resources drop down in Build Phases so it should find it fine. If I try to print out the URL in the simulator and paste it into Safari it loads and plays the file like normal. I am importing AVFoundation into the class and the framework into the project.</p>