iOS 17 Simulator Issue: Error Message and lag when playing audio via AVAudioPlayer

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!

Thanks for posting. Did you find any solution. I am having the same issue?

I am also experiencing the same issue with iOS 17.2 and XCode 15.

Thanks for posting, having the same issue. It's not working on my iPhone with iOS 17.3 either.

Same issues here with 17.4

Same here, in Simulator <= 16.x it does not occur. This error also causes lag in program execution; for instance in games with multiple audio objects playing it will stall the game, rendering testing in the Simulator useless.

https://feedbackassistant.apple.com/feedback/13193810 (AVAudioPlayer init very slow on iOS 17 Simulator)

We are having the same issue and is really affecting our development. :(

I am getting this error message along with "AddInstanceForFactory: No factory registered for id..." in the simulator, but no performance hit from what I can tell. However, I have encountered a slew of new performance issues on my physical device (iPhone 12, iOS 17.2.1), even before anything audio-related is initialized. I am forced to postpone audio features until this has been resolved.

iOS 17 Simulator Issue: Error Message and lag when playing audio via AVAudioPlayer
 
 
Q