Rockbox.org home
release
dev builds
extras
themes manual
wiki
device status forums
mailing lists
IRC bugs
patches
dev guide



Rockbox mail archive

Subject: Re: Gapless Playback Engine
From: Björn Stenberg (bjorn_at_haxx.se)
Date: 2004-10-25


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.

-- 
Björn
_______________________________________________
http://cool.haxx.se/mailman/listinfo/rockbox



Page was last modified "Jan 10 2012" The Rockbox Crew
aaa