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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thanks for the tip! 

What codec should I use then ?

Thanks
-----------------------------------------------------------------------
Martin RATINAUD
-----------------------------------------------------------------------


On Mon, Dec 16, 2019 at 9:44 PM Måns Rullgård <mans@xxxxxxxxx> wrote:
Martin Ratinaud <martinratinaud@xxxxxxxxx> 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
_______________________________________________
Sox-users mailing list
Sox-users@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/sox-users

[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Photo Sharing]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux