pouët.net

0's at the beginning and end of an mp3

category: code [glöplog]
 
So it seems most mp3 decoders introduce a small delay at the beginning of the decoded stream. This delay being 528 samples. This is because the standard
MDCT/filterbank routines used by the ISO have a 528 sample delay.

Same thing happens while encoding, 528 samples.

So I've skipped my output stream by 1056 samples and still notice a hiccup of silence in one of my loops.

Has anyone else encountered this? Should I just throw away samples? If so, how many? Because 1056 doesn't seem to be it.
added on the 2014-06-20 23:57:03 by sigflup sigflup
You don't know unless the MP3 file in question has a LAME header, which will tell you how many samples to skip.
oh!! that's neat!
added on the 2014-06-21 02:05:35 by sigflup sigflup
So, you coming to evoke again, eh?! Nice!
Maybe this time we´ll talk a bit or a byte. Altho i don´t think so, will be smashed once again 2 hours after arrival, as always! ;)
gl with your loopy! ;)
Couldn't you just count the zeros when you load the mp3?
added on the 2014-06-21 21:32:07 by xeron xeron
Well, you could of course remove any kind of silence (you'll need some threshold since there will be some ringing artefacts close to the start and end of the actual audio), but that only works if you assume that there will never be any kind of intended silence at the start or end of the MP3 file. Plus, it's possible that it won't be 100% sample-accurate because of said artefacts. Really, the easiest way is to generate an MP3 file with LAME headers that tell you precise how many samples are not part of the original stream.
Or save .wav files with mp3 data. Then you can add loop markers yourself.
added on the 2014-06-21 22:00:30 by booster booster
How about using a format that doesn't have this sort of crap? (Vorbis, Opus)
added on the 2014-06-22 16:19:05 by Sesse Sesse
Plus, less patent shizzle.
yeah, what about opus? i heard it is good.
added on the 2014-06-23 15:53:10 by wysiwtf wysiwtf

login