Unsuccessful playback with AVQueuePlayer / AVPlayer - is this possible?

I played with AVPlayer and its subclass AVQueuePlayer (and the MPMediaItem s array), and found that the latter works better with gapless albums, but doesn't seem to complete the task completely.

There is a very noticeable pause between the current and the next track when using the AVPlayer replaceCurrentItemWithPlayerItem method. But using the AVQueuePlayer advanceToNextItem method, the gap is much narrower.

The only parameters are these two classes, since I am dealing with AVPlayerItem , which contain the URLs of assets from items in the iTunes music library. Then the question arises: is it possible to get seamless playback using the iOS SDK?

+7
source share
2 answers

You can use the AVAssetReader or Extended Audio File Services API to read data from audio files, and then feed uncompressed audio data to the Audio Unit mixer with any gap you want, without spaces, overlapping, or even mixing. The proper use of all of these APIs is non-trivial.

+8
source

Have you tried using the https://github.com/tumtumtum/StreamingKit framework for gapless playback? I am trying to explore this topic myself.

0
source

All Articles