Well, for anyone facing this that wants a workaround, you can actually still make the WKAudioFilePlayer work despite the shenanigans of the non-working "Choose where to play music:" prompt.
//keep your player nullable & in global scope
var player: WKAudioFilePlayer?
class WhateverController: WKInterfaceController {
//don't invoke play, don't add a KVO
//set its rate to 0.999
//optionally add a quick delay to set it 1
@IBAction func playButtonTapped() {
let url = Bundle.main.url(forResource: "sample", withExtension: "mp3")!
let item = WKAudioFilePlayerItem(asset: WKAudioFileAsset(url: url))
player = WKAudioFilePlayer(playerItem: item)
player!.rate = 0.999
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.01) {
player!.rate = 1
}
}
}
😠 😢 😁
Additionally, if you want to hide the prompt, add this after setting the rate:
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.5) {
if player == nil || player!.currentTime == 0 { return }
OperationQueue.main.addOperation {
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.01) {
self.dismiss()
}
}
}