HydrogenAudio

Lossy Audio Compression => MP3 => MP3 - Tech => Topic started by: apastuszak on 2017-02-27 18:48:20

Title: iTunes MP3 Gapless
Post by: apastuszak on 2017-02-27 18:48:20
I tried doing a search on the forum and didn't have much luck.

Does anyone know where iTunes stores it's gapless information for MP3 files.  Do they use tags, or is it stored in the iTunes database?

If it does use tags, do you know the name of these custom tags?
Title: Re: iTunes MP3 Gapless
Post by: saratoga on 2017-02-27 19:01:05
It is stored in a tag:

https://github.com/Rockbox/rockbox/blob/d7871914acd2ed77f43344e36e08944524a67d9e/lib/rbcodec/metadata/id3tags.c#L983
Title: Re: iTunes MP3 Gapless
Post by: apastuszak on 2017-02-27 19:14:56
According to this site:

http://joelverhagen.com/blog/2010/12/how-itunes-uses-id3-tags/

The iTunSMBP tag, which was in the Rockbox code snipet you linked to has a 0 or 1 value to let you know if it's part of a gapless album.  Is that all that's really needed to make something gapless?
Title: Re: iTunes MP3 Gapless
Post by: apastuszak on 2017-02-27 20:10:03
Upon further Googling, I have learned that the iTunSMBP tag is actually a hex value and that website was wrong.  Is there any advantage of disadvantage to iTunes implementation vs what LAME does?
Title: Re: iTunes MP3 Gapless
Post by: saratoga on 2017-02-27 21:56:02
http://joelverhagen.com/blog/2010/12/how-itunes-uses-id3-tags/

The iTunSMBP tag, which was in the Rockbox code snipet you linked to has a 0 or 1 value to let you know if it's part of a gapless album.  Is that all that's really needed to make something gapless?

It is actually two numbers, one of which is the number of samples to remove at the end, and the other the beginning.  Take a look at the rockbox parser I posted above. 

Upon further Googling, I have learned that the iTunSMBP tag is actually a hex value and that website was wrong.

Not too surprising given the what the link says:  '"iTunSMPB". I don't know what this field means.'

Is there any advantage of disadvantage to iTunes implementation vs what LAME does?

They're effectively equivalent.  The rockbox parser just loads the same information from whichever location includes it.

Title: Re: iTunes MP3 Gapless
Post by: kode54 on 2017-02-28 21:02:43
The counts are similar to LAME's format.

The decoder delay of 529 must be subtracted from the padding field before removing its count from the end of the file.
Title: Re: iTunes MP3 Gapless
Post by: apastuszak on 2017-03-01 19:56:02
Thank you everyone for educating me.