How to change the play speed rate on AVPlayer (swift)

Fredric Cliver
Oct 31, 2020

--

When you play audio with the AVPlayer, you would use this

player = AVPlayer.init(playerItem: playerItem)
player?.play()

There a specific property to calibrate the audio play speed rate. You can use the ‘rate’ property.

player = AVPlayer.init(playerItem: playerItem)
player?.rate = 0.7
player?.play()

But, in this case, it doesn’t work. You have to place after “.play()”

player = AVPlayer.init(playerItem: playerItem)
player?.play()…

--

--

Fredric Cliver

Majored in Physics, self-taught and worked in the IT industry as a Dev/Design/Planning for 11 years. And I had run my Startup for 3 years. I fancy a ☔️ 🇬🇧