Post

Replies

Boosts

Views

Activity

Reply to Using AVFoundation to play audio asset results in error
I've performed the following test successfully in Xcode 11.5 with an iOS 13 simulator. class ViewController: UIViewController {     var audioPlayer: AVAudioPlayer!     override func viewDidLoad() {         super.viewDidLoad()         guard let audioData = NSDataAsset(name: "Example")?.data else {             fatalError("Asset not found")         }         do {             self.audioPlayer = try AVAudioPlayer(data: audioData, fileTypeHint: "m4a")             self.audioPlayer.play()         } catch {             fatalError(error.localizedDescription)         }     } } Sadly this same example does not work in iOS 14. I've filed a radar (FB7800041) about this.
Jun ’20