Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AVPlayer : change rate with NO pitch correction?

I am using the rate property of AVPlayer to change the playback speed of an audio sample. It seems to always apply pitch correction, but I want no pitch correction so that when it speeds up it gets higher like a record or an old tape player. Is there any way to shut off pitch correction altogether in AVPLayer?

I am currently using Swift 3, but Objective C answers are welcome, too.

like image 874
synthcat Avatar asked Sep 08 '25 00:09

synthcat


1 Answers

Actually, this is possible with AVPlayer --

let player = AVPlayer(url: fileURL)

// to turn off pitch correction:

player.currentItem?.audioTimePitchAlgorithm = .varispeed

like image 88
spitchay Avatar answered Sep 10 '25 00:09

spitchay