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: editing gapless mp3 header information, foobar 0.8 vs. 0.9 (Read 7572 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

editing gapless mp3 header information, foobar 0.8 vs. 0.9

I really appreciate foobar2000's ability to edit the LAME-style gapless playback information stored in the header. I'm referring to the ENC_DELAY and ENC_PADDING information, the type automatically written by LAME.

This tool can be reached through the context menu (right-click for most people), and is called "Edit MP3 Gapless Playback Information" in foobar2000 0.9. In foobar2000 0.8, it was combined with the "Fix MP3 Header" dialog, which had the option to rebuild the mp3 stream as well as editing the gapless information.

There are a couple of differences in how foobar2000 versions 0.8 and 0.9 handle editing the ENC_DELAY and ENC_PADDING values.

First, 0.8 can't read or write ENC_DELAY values higher than 1152. foobar2000 0.9 can handle this just fine, which was useful when I bought mp3's of a live album which happened to have a delay of 1679 samples - with foobar2000 0.9, I could edit these. But when foobar2000 0.8 sees these files, it reads the ENC_DELAY value as zero.

Secondly, foobar2000 0.9 has lots more ability to handle the ENC_PADDING value. 0.9 has nifty "up" and "down" buttons that let you adjust the desired length of the track in increments of 588 samples. this is convenient because any track ripped from a cd will be in increments of 588 samples (75 sectors of 588 samples = 44,100 samples, or 1 second)

However, while the dialog boxes from both 0.8 and 0.9 say "enter 0 to disable padding", this only works in 0.8.
- in 0.8, entering 0 would mean that the ENC_PADDING value was zero
- in 0.9, entering 0 puts a default delay value of 4095 samples (which foobar2000 0.8 cannot read). If there is already a value written for ENC_PADDING, entering 0 leaves that value.

In a lot of cases I would like to just leave the ENC_PADDING value at zero. This is useful for mp3's that don't any added silence at the end of their stream.

Back when I was using foobar2000 0.8, I could just enter 0 to disable padding, and I would get an ENC_PADDING value of zero.
But with 0.9, this becomes much more difficult. The initial value is at 4095, and you can click the nifty "up" button to get the value smaller, in increments of 588 samples per click.
It turns out that an ENC_PADDING value of 529 or lower decodes the same as if it were zero. So for some mp3's, editing their gapless information in foobar2000 0.9, I just click until the ENC_PADDING value shows somewhere between 0 and 529.

But it seems like there should be a cleaner way to do this.
I don't know all the ins and outs of writing gapless playback information, but I'm curious if there is a way to do what I want to do (enter 0 to disable padding), or perhaps I'm just trying to do the wrong thing?
Thanks for any help here.
God kills a kitten every time you encode with CBR 320

editing gapless mp3 header information, foobar 0.8 vs. 0.9

Reply #1
I wrote the previous post both because I'm honestly curious how the LAME gapless standard works (how the number-values are stored, how interpreted, and why some are more impervious to mp3-editing software than others.

The final reason is also the proximate and practical cause of my writing the post.
I've been looking at how mptrim, mp3val, and mp3packer affect gapless values.

mptrim strips ENC_DELAY and ENC_PADDING written by LAME, but usually doesn't strip values written by foobar2000

I wrote the previous post both because I'm honestly curious how the LAME gapless standard works (how the number-values are stored, how interpreted, and why some are more impervious to mp3-editing software than others.

The final reason is also the proximate and practical cause of my writing the post.
I've been looking at how mptrim, mp3val, and mp3packer affect gapless values.

mptrim strips ENC_DELAY and ENC_PADDING values written by LAME in the encoding process, but usually doesn't strip values written in by foobar2000.

in mp3val, files with foobar-edited gapless values often show up as having a problem (Wrong number of MPEG data bytes specified in Xing header) but when I fix these files with mp3val, the gapless info remains, mp3val has just written the correct number of bytes into the Xing header to correspond with the ENC_DELAY and ENC_PADDING values.
This implies that foobar2000, when editing the gapless values in an mp3 file, doesn't change the specified file length in the Xing header.

Finally, mp3packer. This is the most difficult to figure out.
MP3Packer strips gapless info (both delay and padding set to zero) when
- timing value is off (so if I've fixed with mp3val already, no problem)
- padding value between 1 and 528, over over 2000

others that don't fit this description are sometimes messed up, but all such are files that had values edited in foobar2000 0.9

Usually, original tags from LAME encoding aren't stripped

gapless values written by foobar2000 are less likely to be stripped my mp3packer if the file was run through mp3val (and fixed if necessary).
God kills a kitten every time you encode with CBR 320

editing gapless mp3 header information, foobar 0.8 vs. 0.9

Reply #2
I'm blatantly bumping this. I realize I wrote a lot here, and maybe no one wants to wade through it, but I'm kinda surprised that no-one has comments on the various ways that LAME's gapless-playback info gets written to files.
* why some gapless info gets stripped by certan programs, and others isn't
* the differences between info written (and capabilities to write info) by fb2k 0.8 and 0.9

To me, the issues I've mentioned here are kind of a black hole - I really don't know what is going on, and am curious. I'd be pleased if anyone knows. Thanks.
God kills a kitten every time you encode with CBR 320

editing gapless mp3 header information, foobar 0.8 vs. 0.9

Reply #3
Funny thing i just found out what it does, i just dont know how to set or use it...so i dont know any of these problems you experience...

 

editing gapless mp3 header information, foobar 0.8 vs. 0.9

Reply #4
Has the ability to edit ENC_DELAY and ENC_PADDING information been removed from 1.0?

editing gapless mp3 header information, foobar 0.8 vs. 0.9

Reply #5
Has the ability to edit ENC_DELAY and ENC_PADDING information been removed from 1.0?

Not at all, the functionality appears the same as it was in the 0.9 versions of fb2k. I've used it since updating to 1.0 and have had no problems.
God kills a kitten every time you encode with CBR 320

editing gapless mp3 header information, foobar 0.8 vs. 0.9

Reply #6
Not at all, the functionality appears the same as it was in the 0.9 versions of fb2k. I've used it since updating to 1.0 and have had no problems.


I only see "Fix VBR MP3 Header" and "Rebuild MP3 Stream" in utilities (fb2k 1.0). There's no "Edit MP3 Gapless Playback Information."

editing gapless mp3 header information, foobar 0.8 vs. 0.9

Reply #7
The option is still there, it just isn't enabled to show in the context menus (right-click) by default. You'll need to go into preferences --> display --> context menu --> utilities and check the box.

I forgot about this because I have a keyboard shortcut programmed for the utility, that carried over when I updated to 1.0 (so I never set it to display in the context menu).
God kills a kitten every time you encode with CBR 320

editing gapless mp3 header information, foobar 0.8 vs. 0.9

Reply #8
It will also show if you hold the shift key when opening the context menu.


editing gapless mp3 header information, foobar 0.8 vs. 0.9

Reply #10
Sorry for bumping, but I'm also interested in some of the questions timcupery asked and couldn't find the answers.

Why the default ENC_PADDING value foobar sets when fixing VBR header is 4095, why not zero?
Why it can not be automatically set to zero, although the edit dialog says "enter 0 to disable padding"?
Should this behaviour be considered a bug or is there some reasoning behind this?

editing gapless mp3 header information, foobar 0.8 vs. 0.9

Reply #11
And a bump 4 years later. Just strip the "enter 0 to disable padding" from the description if it isn't supposed to work!

editing gapless mp3 header information, foobar 0.8 vs. 0.9

Reply #12
I can't get it to save any value, let alone zero. Delay works fine.
Project Leader of DDResampled