Does anybody got any luck playing sound on Apple Watch? I have tried since watchOS 2 and never get to work. In watchOS 3 documentation (https://developer.apple.com/library/prerelease/content/documentation/General/Conceptual/WatchKitProgrammingGuide/AudioandVideo.html#//apple_ref/doc/uid/TP40014969-CH24-SW19), it says:
Any audio you play is routed to a paired Bluetooth headset if one is available. If no Bluetooth headset is available, audio is routed to the Apple Watch speaker.
Here's my code - instead of hearing the sound, the UI hung. I have placed the sound asset ShipHit.m4a in both Watch App and Watch Extension for testing purpose.
let url = NSURL.fileURL(withPath: Bundle.main().pathForResource("ShipHit", ofType: "m4a")!)
let asset = WKAudioFileAsset(url: url)
let playerItem = WKAudioFilePlayerItem(asset: asset)
soundPlayer = WKAudioFilePlayer(playerItem: playerItem)
...
if soundPlayer.status == .readyToPlay {
soundPlayer.play()
}