Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Helix MP3 encoder and gapless playback - not gapless in fb2k (Read 358 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Helix MP3 encoder and gapless playback - not gapless in fb2k

Hi there,

I'm currently tinkering with the Helix MP3 encoder (some compile fixes, easy bug fixes etc.).

https://hydrogenaud.io/index.php/topic,123331.0.html
https://github.com/maikmerten/hmp3

I hacked in some support for the LAME info tag to enable decoding to the original number of samples. LAME, which also contains a decoder, creates decodes with the proper number of samples. So does Audacity. However, while fb2k seems to trim away surplus samples at the start, it's leaving some of the padding at the end, ruining gapless playback.

For testing, here are some files:

  • sine441.wav - original WAV file. 44100 samples long, containing a 441 Hz sine wave. Loops perfectly.
  • sine441-lame.mp3 - test file encoded with LAME. Plays back without gaps in fb2k
  • sine441-helix.mp3 - test file with my version of the Helix MP3 encoder, with LAME info tag (decodes fine with LAME decoder and Audacity, not fine in fb2k)

Now, it's very possible that the blame is with my info tag writing code - but I'd really love to understand what confuses fb2k when LAME and Audacity are happy. So this is not necessarily a bug in fb2k, but perhaps a corner case of the info tag spec I'm not aware of...

Re: Helix MP3 encoder and gapless playback - not gapless in fb2k

Reply #1
Thanks for the sample files.
foobar2000 relies on frame count field to know when to stop decoding, instead of decoding till EOF and discarding last N samples.
Please check your frame count field, I believe it's not meant to include the VBR header itself.
We are the bork. Your software bugs will be added to our own. Resistance is futile.

 

Re: Helix MP3 encoder and gapless playback - not gapless in fb2k

Reply #2
Thanks for the sample files.
foobar2000 relies on frame count field to know when to stop decoding, instead of decoding till EOF and discarding last N samples.
Please check your frame count field, I believe it's not meant to include the VBR header itself.

Hi Peter, thanks a lot for providing this detailed information! Indeed, there was a "off-by-one" problem in Helix regarding the frame count field in the Xing-section of the VBR header. I now have wonderfully looping sine waves in fb2k :-)