title: Swift 3: Playing Audio based on a string variable
body: <p>so I see that the way to play audio in Swift 3 would be </p>
  
  <pre><code>do {
      audioPlayer = try AVAudioPlayer(contentsOf: URL.init(fileURLWithPath: Bundle.main.path(forResource: "name", ofType: "mp3")!))
      audioPlayer.prepareToPlay()
      audioPlayer.play()
  }
  catch {
  print(error)
  }
  </code></pre>
  
  <p>but instead of the set string of "name" I want to have a variable called <strong>string</strong> that could be one of 100 different strings corresponding to different filenames. Swift doesn't allow this by simply putting <strong>string</strong> in place of "name" so what's the fix?</p>