Rockbox mail archiveSubject: Re: Gapless Playback Engine
From: Björn Stenberg (bjorn_at_haxx.se)
Spam Me wrote:
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