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 wrote: > Martin Ratinaud 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 >