Friday, 28 September 2018

The sound quality of slow playback using AVPlayer is not good enough even when using AVAudioTimePitchAlgorithmSpectral

In iOS, playback rate can be changed by setting AVPlayer.rate. When AVPlayback rate is set to 0.5, the playback becomes slow.

By default, the sound quality of the playback at 0.5 playback rate is terrible. To increase the quality, you need to set AVPlayerItem.audioTimePitchAlgorithm.

According to the API documentation, setting AVPlayerItem.audioTimePitchAlgorithm to AVAudioTimePitchAlgorithmSpectral makes the quality the highest.

The swift code is:

AVPlayerItem.audioTimePitchAlgorithm = AVAudioTimePitchAlgorithm.spectral // AVAudioTimePitchAlgorithmSpectral

AVAudioTimePitchAlgorithmSpectral increases the quality more than default quality. But the sound quality of AVAudioTimePitchAlgorithmSpectral is not good enough. The sound still echoed and it is stressful to listen to it.

In Podcast App of Apple, when I set playback speed to 1/2, the playback becomes slow and the sound quality is very high, no echo at all.

I want my app to provide the same quality as the Podcast App of Apple.

Are there iOS APIs to increase sound quality much higher than AVAudioTimePitchAlgorithmSpectral?

If not, why Apple doesn't provide it, even though they use it in their own Podcast App?

Or should I use third party library? Are there good libraries which is free or low price and which many people use to change playback speed?



from The sound quality of slow playback using AVPlayer is not good enough even when using AVAudioTimePitchAlgorithmSpectral

No comments:

Post a Comment