Gapless playback with AVQueuePlayer/AVPlayer - is it possible?
Asked Answered
L

2

7

I've been playing around with the AVPlayer and its subclass AVQueuePlayer (and an array of MPMediaItems) and have found that the latter performs better with gapless albums, but neither seem to fully achieve the task.

There is a very noticeable pause between the current and next track when using AVPlayer's replaceCurrentItemWithPlayerItem method. But with AVQueuePlayer's advanceToNextItem method the gap is much more narrow.

The only options are these two classes since I'm dealing with AVPlayerItem's that contain Asset URLs from items in the iTunes music library. This then begs the question, is it at all possible to achieve gapless playback with the iOS SDK?

Lianna answered 23/4, 2012 at 17:46 Comment(0)
R
9

You can use the AVAssetReader or Extended Audio File Services API to read data from the audio files, and then feed uncompressed audio data to an Audio Unit mixer with any desired gap, gapless, overlap, or even mix. Proper use of all these APIs is non-trivial.

Roughage answered 23/4, 2012 at 18:15 Comment(0)
A
0

Have you tried using https://github.com/tumtumtum/StreamingKit framework for gapless playback? Im trying to research this topic my self.

Arena answered 1/2, 2016 at 21:13 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.