dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: Re: Gapless Playback Engine

Re: Gapless Playback Engine

From: Björn Stenberg <>
Date: Mon, 25 Oct 2004 16:47:38 +0200

Spam Me wrote:
> To me it seems natural to use this "opportunity" to make a
> playback-engine for iRiver which support both gapless playback and
> maybe even crossfading capabilities.

We only have to adjust the current playback engine a little. Rockbox uses a single-buffer system which feeds mp3 data to the the hardware mp3 decoder.

On devices with software decoders we need dual buffers: One to feed mp3 data to the decoder and one to feed the decoded pcm data to the DAC.

Gapless playback is simply a matter of removing the blank samples from the end of the decoded mp3 data. The number of blank samples varies a bit between encoders. Some encoders (such as lame) stores this number in the file for us to use, but as a fallback if the file has no such information we can just remove up to X blank samples from the end.

Crossfading is also not very complex. Instead of writing the files after each other in the pcm buffer, we mix the first few seconds of pcm data from track2 with the last few seconds of pcm data from track1 as it is delivered from the decoder.

Received on 2004-10-25

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy