Re: lame inserting 0.047 seconds of silence in the beginning of the mp3 file

nick humphrey <[email protected]>
Newsgroups gmane.comp.audio.mp3.lame
Message-ID <CAKDOLajJAdyO0_YjOgoVxwBVVaV9rH6zOwRwPAa0j=eOcEOcVQ@mail.gmail.com>
"at least it should be obvious that it needs to bring the sample
count to a multiple of the MPEG frame size"

whatchoo talkin' 'bout willis? =)


"Are you really using mpg123 or is this mpg321 masquerading as mpg123
(this should be less  common nowadays, but to make sure, please have a
look at `mpg123 --version`)?"

shell$ mpg123 --version
mpg123 1.12.1


"Input and output WAV do have the same size. That's how it should be.
Can you do that test with your setup?"

shell$ lame test.wav test.mp3
LAME 3.99.3 64bits (http://lame.sf.net)
Using polyphase lowpass filter, transition band: 16452 Hz - 17032 Hz
Encoding test.wav to test.mp3
Encoding as 48 kHz j-stereo MPEG-1 Layer III (12x) 128 kbps qval=3
    Frame          |  CPU time/estim | REAL time/estim | play/CPU |    ETA
   103/103   (100%)|    0:00/    0:00|    0:00/    0:00|   30.900x|    0:00
--------------------------------------------------------------------------------------------------
   kbps        LR    MS  %     long switch short %
  128.0        1.0  99.0        73.8  15.5  10.7
Writing LAME Tag...done
ReplayGain: +1.9dB

shell$ mpg123 -w test_again.wav test.mp3
High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
version 1.12.1; written and copyright by Michael Hipp and others
free software (LGPL/GPL) without any warranty but with best wishes

Playing MPEG stream 1 of 1: test.mp3 ...
MPEG 1.0 layer III, 128 kbit/s, 48000 Hz joint-stereo

[0:02] Decoding of test.mp3 finished.

shell$ ls -la
-rw-rw-r-- 1 nick nick 465496 2012-02-23 22:55 test_again.wav
-rw-rw-r-- 1 nick nick  39936 2012-02-23 22:53 test.mp3
-rw-r--r-- 1 nick nick 698222 2012-02-18 13:39 test.wav

test_again.wav does not have the silence in the beginning.

i compared both our outputs from lame and mpg123 and noticed nothing,
except that you are using a newer version og mpg123, which i would think
would be irrelevant.


"With plain ALSA, I can play MP3 albums ripped from CDs
that have the tracks seamlessly blended into one another and not notice
any gap."

i think ubuntu 11.10 uses ALSA under pulse as the default setup, but i cant
imagine the audio framework is of any relevance here. i might be wrong.
i'll send you the small test files i'm working with in a personal mail.
thanks for your attention so far =)

nick



2012/2/23 Thomas Orgis <[email protected]>

> Am Thu, 23 Feb 2012 17:10:39 +0100
> schrieb nick humphrey <[email protected]>:
>
> > i dont understand. the mp3 file is encoded from a wav source file using
> > *lame*. what does audacity or mpg123 have to do with it? it seems like
> > you're suggesting that the silence is normal/intended and that the
> program
> > you play it with is supposed to cut out the silence??? or have i
> > misunderstood?
>
> You understood correctly. The MP3 format includes encoder and decoder
> delays; at least it should be obvious that it needs to bring the sample
> count to a multiple of the MPEG frame size. There are technical reasons
> for this. Lame is helpful in telling how many samples it added, the
> decoder needs to interpret that (and deal with its own delay, too).
>
> Most players don't really care about that (or did in the past, at
> least), and in fact many people think MP3 files cannot be "gapless".
> But they can; I specifically worked on that feature in the mpg123
> decoder.
>
> > i run this:
> > mpg123 --loop 4 funky_drummer_1.mp3
> >
> > and the silence is there. it doesnt loop smoothly.
>
> Can you send me (personal mail, the list might not like this) the WAV
> and MP3 to verify what is going on there (I hope it's a small sample
> file)?
>
> Are you really using mpg123 or is this mpg321 masquerading as mpg123
> (this should be less  common nowadays, but to make sure, please have a
> look at `mpg123 --version`)?
>
> This works for me:
>
> shell$ lame left.wav left.mp3
> LAME 3.98.2 64bits (http://www.mp3dev.org/)
> Using polyphase lowpass filter, transition band: 16452 Hz - 17032 Hz
> Encoding left.wav to left.mp3
> Encoding as 48 kHz j-stereo MPEG-1 Layer III (12x) 128 kbps qval=3
>    Frame          |  CPU time/estim | REAL time/estim | play/CPU |    ETA
>    80/80    (100%)|    0:00/    0:00|    0:00/    0:00|   32.000x|    0:00
>
> ------------------------------------------------------------------------------------------------------
>   kbps        LR    MS  %     long switch short %
>  128.0       98.8   1.2        91.9   5.0   3.1
> Writing LAME Tag...done
> ReplayGain: -6.1dB
>
> shell$ mpg123 -w left_again.wav left.mp3
> High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
>        version 1.13.4; written and copyright by Michael Hipp and others
>        free software (LGPL/GPL) without any warranty but with best wishes
>
> Playing MPEG stream 1 of 1: left.mp3 ...
> MPEG 1.0 layer III, 128 kbit/s, 48000 Hz joint-stereo
>
> [0:01] Decoding of left.mp3 finished.
>
> shell$ ls -l left*.wav
> -rw-r----- 1 thomas users 358700 23. Feb 22:18 left_again.wav
> -rw-r----- 1 thomas users 358700 11. Aug 2010  left.wav
>
> Input and output WAV do have the same size. That's how it should be.
> Can you do that test with your setup? If you have the same size but
> still a gap when looping, then perhaps it's an issue with the audio
> output code. With plain ALSA, I can play MP3 albums ripped from CDs
> that have the tracks seamlessly blended into one another and not notice
> any gap.
>
>
> Alrighty then,
>
> Thomas.
>
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> Lame-dev mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/lame-dev
>
>
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.