When I play a m4a file on the new iOS 17 Simulator (17.0 and 17.2), the following error message appears and there is a noticeable lag on the simulator.
The error and the lag don't happen on a real device (iOS 17.2) or the 16.4 simulator. This significantly affected my development experience as when there's a sound, I can't tell whether there's a performance issue of my code or not.
Error Message:
AudioQueueObject.cpp:5933 DetermineMetadataTimestamp unable to obtain valid timestamp, estimate:33506.000000
Code:
var player: AVAudioPlayer!
let url = Bundle.main.url(forResource:"k-be", withExtension: "m4a")!
if player != nil { player?.stop() player = nil }
player = try AVAudioPlayer(contentsOf: url)
guard let player = player else { return }
player.play()
Here's the Feedback ID:
FB13473463 (iOS 17 Simulator: Error Message and lag when playing audio via AVAudioPlayer)
Thanks!