title: Playing audio in asset library
body: <p>I'm trying to load/play an audio file store in the assets library but for some reason it can not be found in the bundle.</p>
  
  <p><a href="https://i.stack.imgur.com/kxDnF.png" rel="noreferrer"><img src="https://i.stack.imgur.com/kxDnF.png" alt="enter image description here"></a>
  Here is my code:</p>
  
  <pre><code>func playAudio() {
  
      let path = Bundle.main.path(forResource: "sound", ofType:nil)!
      let url = URL(fileURLWithPath: path)
  
      do {
         sound = try AVAudioPlayer(contentsOf: url)
          sound?.play()
      } catch {
          // do something
      }
  }
  </code></pre>
  
  <p>Any of you knows what I'm doing wrong? or why Xcode can not find the file?</p>