Re: Wav to Mp3 leads to an mp3 file that has a longer duration

Måns Rullgård <[email protected]>
Newsgroups gmane.comp.audio.sox
Message-ID <[email protected]>
Martin Ratinaud <[email protected]> writes:

> Ok, thanks.
>
> But would it be possible to
> - add silence samples at the end of the wav file so that is is a multiple
> of 1152
> - convert it to an mp3
> - and get the exact same number of samples with no change between wav
> duration and mp3 duration
>
> Because I just test with a wav file that is 8640000 samples = 7500 * 1152
> and when I convert it to an mp3, I get 8641152 samples

Apparently the LAME encoder is adding an extra frame for some reason.
MP3 is weird like this.  If you need the number of samples to be exact,
you'll have to switch a more modern codec.

-- 
Måns Rullgård
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.