Simulator hangs when trying to use AVAudioPlayer

Just trying to run my app in Xcode 12 on Catlina 10.15.5 and wondered if anyone else can reproduce this issue before I file a bug report.

My app builds and runs on a device just fine, and also builds and runs on device/simulator in Xcode 11 but if I try and run the app in the Xcode 12 simulator (I've tried several simulators) it hangs as soon as I try and call .prepareToPlay() or .play() on a valid instance of AVAudioPlayer.

Just to rule out any quirks of my app code, I've dropped in some code directly into the top of my Scene delegate:

Code Block
let audioPlayer = try! AVAudioPlayer(contentsOf: AudioEffects.beepSoundEffectURL)
audioPlayer.prepareToPlay()
audioPlayer.play()


This is enough to trigger the hang - if I hit pause in the debugger I can see it's hanging on a mutex wait on the main thread in the prepareToPlay method call.

I seem to be able to reproduce this with SwiftUI live previews as well.
If you haven't already, could you file feedback using Feedback Assistant (attaching the code for the SwiftUI preview that demonstrates the hang), and share the feedback number here?
Report filed using feedback assistant - feedback number FB7783580.

I've included some screenshots of the thread inspector, log output and attached a sample project.
Thank you! Could you also collect some additional diagnostics by running xcrun simctl diagnose and attaching the resulting file to the feedback item?

Could you also confirm whether you've been able to run the code successfully on a physical device, or have you only tried running though Simulator/Previews so far?
Simulator hangs when trying to use AVAudioPlayer
 
 
Q