title: No sound when playing mp3 in iOS using swift
body: <p>There is no error message when playing the sound.  I put a print statement for testing, and the url is getting the right path.  The play button clicks, and I hear a faint click sometimes, but that's it.  No other sound comes out.  I've tried different mp3 files.  I get an error message if I delete the mp3 file. I've checked the volume.</p>
  
  <p>The play button is in a second view controller.  The main view controller has a table view.  When user taps on the cell, it takes him to this view controller.</p>
  
  <pre><code>//  DetailVC.swift
  
  import AVFoundation
  import UIKit
  
  class DetailVC: UIViewController {
  
      var duaPlayer = ""  //is this correct???
  
  
      override func viewDidLoad() {
          super.viewDidLoad()
  
      }
  
  
  
      @IBAction func playbutton(sender: AnyObject) {
  
          do {
          let url = NSBundle.mainBundle().URLForResource("track1", withExtension: "mp3")
  
        var duaPlayer = try AVAudioPlayer(contentsOfURL: url!)
  
              duaPlayer.prepareToPlay()
              print (url)
              duaPlayer.volume = 0.5
  
              duaPlayer.play()
          }
  
          catch
          { fatalError("err")}
  
      }
  </code></pre>