Gapless playback on iPhone
Live albums, DJ mixes and symphonies are cut into tracks, but they were recorded as one piece. MiniJack joins the tracks again with no gap and no click, for files on the device and for songs streamed from your server.
Why most players leave a gap
Lossy encoders add a little silence at the start of a file and pad the end. The amount is written in the file, if the encoder wrote it at all. A player that ignores it plays the padding, and you hear a short gap or a tick where two tracks meet.
What MiniJack reads
- MP3: the LAME tag's encoder delay and padding.
- AAC and ALAC in M4A: the iTunes gapless tag, or the edit list that ffmpeg writes.
- FLAC and WAV: the exact sample count.
- Ogg Opus: the pre-skip and the final granule position.
The same reader runs on local files, on downloads and on streams, so a streamed album joins as cleanly as a downloaded one. The next track is prepared while the current one plays.
How it's tested
The test suite plays a single recording cut into three tracks, in each format, and records what comes out. On an iPod touch with iOS 15.8.8 every join is off by zero samples. An MP3 without a LAME tag can't be trimmed exactly; MiniJack trims it with a safe margin and marks it in the song's details.
Streams with a bitrate limit
If you set a streaming bitrate limit, the server transcodes, and transcoded MP3 streams usually lose the data a gapless join needs. For albums that must join cleanly, stream the original or download it.
Crossfade
Crossfade is off by default and can be set from 1 to 12 seconds. Songs from one album playing in album order still join gapless, so turning crossfade on doesn't spoil a live record.