naudio / NLayer

MPEG 1 & 2 Decoder for Layers 1, 2, & 3
MIT License
123 stars 30 forks source link

File decodes to a longer length than the audio #9

Open roncli opened 6 years ago

roncli commented 6 years ago

Attached is an MP3 file I created. It is intended to be used as a loop.

In Adobe Audition, it decodes to a length of 1,181,541 samples, and loops seamlessly.

In NLayer, it decodes to a length of 1,184,256 samples, which includes 2,715 extra samples, or approx 2.36 frames of additional audio, which are largely inaudible, causing the loop to have a gap.

After some trial and error, I've found that if I take my NLayer data and chop off the first 1,152 samples (a full frame) and the last 1,563 samples (a full frame plus the ending padding), the loop is seamless.

I'm not too familiar with the technical details behind the MP3 format, but it does appear something is off here. Any idea what might be causing this?

title.zip