I am using AVPlayer in my app. My app supports the change of speed of playback of audio and video. I am initializing the player as follows.
AVPlayerItem * playerItem= [AVPlayerItem playerItemWithURL:self.audioUrl];
playerItem.audioTimePitchAlgorithm = AVAudioTimePitchAlgorithmSpectral;
self.player = [AVPlayer playerWithPlayerItem:playerItem];
self.player.allowsExternalPlayback= YES;
[self.player.currentItem addObserver:self
forKeyPath:@"status"
options:0
context:nil];
and when i have to change the playback rate of audio i do as follows
self.player.rate = 2.0f;
It was working fine. But recently when i change the rate property of AVPlayer it start producing choppy voice. I already have set the audioTimePitchAlgorithm
to
AVAudioTimePitchAlgorithmSpectral
but still it producing choppy voice. Can anyone tell me what i am doing wrong, or what i have to do to avoid this choppy voice and to produce smooth sound.
audioTimePitchAlgorithm
toAVAudioTimePitchAlgorithmLowQualityZeroLatency
? might be the latency which causing choppy? – NorthrupAVAudioTimePitchAlgorithmTimeDomain
? not sure this would solve this issue, but at least can locate the core of this issue? – Northrup