Richard,
 
thank you for detailed reply.
 
My file is larger than 5 s (about 20s).
 
There is really a story of multiple of 1152 (or 576).
But if I try to cut the file to do an exact match, it adds... 1152 silent samples. Most being in the begining, some trailing. (more exactly there is some white noise in the blank, but this is perhaps artifact of MP3 encoding))
 
 I tried an exact match minus 1 sample, and things like that, but it did not worked. It seems that there is not some "magic number" where the exact length is preserved. 
 
 I also tried a multiple of 1152 plus 576, it adds... 576 samples of blank.
 
So it seems that there is really a problem with the MP3 length. To give an idea the waw version runs without a hitch (on audacity) when the MP3 has a very audible blank.
 
Richard 
 
 
----- Original Message -----
From: Richard Ash
To: RichardTrigaux
Cc: audacity-help@lists.sourceforge.net
Sent: Monday, September 26, 2005 4:04 PM
Subject: Re: [Audacity-help] Bug with MP3 export: a silence is added at thebeginnig

On Mon, 2005-09-26 at 09:41 +0200, RichardTrigaux wrote:
> I used and enjoyed Audacity.
> My file worked fine, I exported it into wav format, it still worked.
> But when I exported in MP3, a problem appeared.

> This file is to illustrate a web page; it is a continuous sound, which
> plays in an infinite loop.

> But in the MP3 export, there is a short silence added at the
> beginning, of 25 ms, which is harmless if we play the sound once, but
> which ruins the effect when played in a loop. I tried to suppress it,
> and re-export in MP3, but the silence is still there. It is added at
> export.
> My Audacity version is 1-2-3 under windows 2000 and I downloaded the
> version of lame_enc.dll  from 29-7-2004.

There is a known issue with very short files in audacity, caused by
sample rate conversion. If your file is longer than 5 seconds then that
isn't the problem.

You say that the WAV file works but the MP3 file doesn't? This is down
the limitations of the MP3 file format, which is based on encoding
blocks of sound. If there aren't enough audio samples to make a full
block at the end silence is added on, hence the length growth you
describe. In theory there will be a length (in samples of audio) that
won't need padding. One post I found suggested a multiple of 1152
samples, less 576 for the first frame:
  http://www.hydrogenaudio.org/forums/lofiversion/index.php/t36421.html

This should be possible with the samples selection format in audacity
(View > Set Selection Format).

Whether windows MP3 playing is smart enough to take advantage of this
and have it work is another question.

Richard Ash