Search code examples
swiftwatchkitavaudioplayerapple-watchwatchos

Is it possible to play an audio in apple watch simulator? - Xcode 10.1


I am trying to play an audio in apple watch simulator but it keeps giving this error.

The operation couldn’t be completed. (OSStatus error 2003334207.)

Is it possible to play an audio with simulator? Audio url is fine. Here is my code.

self.player = try AVAudioPlayer(contentsOf: url as URL)
player?.prepareToPlay()
player?.volume = 10.0
player?.play()

Solution

  • It is not possible to play an audio with remote URL in apple watch. You need download it first and then play it. Now it's working fine and I can play the audio in simulator as well.