title: Swift5 Play aac file AvAudioPlayer
body: <p>I currently play a wav file with the code below. But now i have compressed the files to aac-files and i can't figure out how to play them? I tried to change the withExtension to "aac" instead but no sound. Any ideas?</p>
  
  <pre><code>guard let url = Bundle.main.url(forResource: fileName, withExtension: "aac") else { return }
  
      do {
          try AVAudioSession.sharedInstance().setCategory(.playback, mode: .default)
          try AVAudioSession.sharedInstance().setActive(true)
  
          let audioPlayer = try AVAudioPlayer(contentsOf: url, fileTypeHint: AVFileType.ac3.rawValue)
          audioPlayer.volume = currentVolume
          newAudioPlayer.audioPlayer.play()
  
      } catch let error {
          print(error.localizedDescription)
      }
  </code></pre>