Welcome Guest ( Log In | Register )

Gapless Playback Detection
post Nov 17 2012, 20:00
Post #1

Group: Members
Posts: 2
Joined: 17-November 12
Member No.: 104594

I'm trying to detect if a mp3 track has been encoded with the gapless option enabled. I'm trying to write a simple player that can quickly detect if the option is enabled. I'm currently testing with tracks encoded using LAME. Wondering if someone can point me to exactly what I should be looking for in the LAME header.

Go to the top of the page
+Quote Post
Start new topic
post Nov 19 2012, 06:30
Post #2

Group: Members
Posts: 1037
Joined: 12-May 06
From: Colorado, USA
Member No.: 30694

Just in case this wasn't clear: the gaplessness is not a property of the MP3's audio data; it's just some hints in the file that the player uses to know what to do with the output of the decoder.

The output of the decoder will be the samples obtained from the MP3, with some junk at the beginning, and probably also at the end. Some or all of the junk at the beginning will have been added by the decoder; this decoder delay is a fixed amount, so it's easy to strip. The encoder probably added junk to the beginning and end of the MP3 itself, as well; this is the encoder delay and padding, respectively. The question is how much of each is there?

The player will probably be coded to work with a specific decoder, so the decoder delay will be known; for any MP3, the player will strip those extra samples from the beginning of the decoder's output. If the MP3 contains encoder delay & padding values, then the player knows to strip that many additional samples from the beginning and end of what remains, respectively. What's left should be the same number of samples as were originally input to the encoder when the MP3 was made.

If delay & padding values aren't available, but the encoder is known, it might still at least be able to make an educated guess at the amount of delay to strip from the beginning. Lame's delay is 576, for example. In the Fraunhofer case, with combined delay & padding in one value, I think you have to do a bit of both (deducing how much is delay and how much is padding based on the encoder version).

This post has been edited by mjb2006: Nov 19 2012, 06:40
Go to the top of the page
+Quote Post

Posts in this topic

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:


RSS Lo-Fi Version Time is now: 27th November 2015 - 11:01