'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 1:[1]
let asset = AVURLAsset(url: url!, options: nil)
let item = AVPlayerItem(asset: asset)
self.player = AVPlayer(playerItem: item)
self.player.play()
self.player.volume = 10.0
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Venus |
