sox-users@lists.sourceforge.net unofficial mirror
 help / color / Atom feed
From: "Måns Rullgård" <mans@mansr.com>
To: Martin Ratinaud <martinratinaud@gmail.com>
Cc: sox-users@lists.sourceforge.net
Subject: Re: Wav to Mp3 leads to an mp3 file that has a longer duration
Date: Mon, 16 Dec 2019 17:44:50 +0000
Message-ID: <yw1ximmgw4fh.fsf@mansr.com> (raw)
In-Reply-To: <CAKy7tYhqcVhahGdbsZEwxrcBw_N0RAt7-CSZcoBUHqwC=LB7hg@mail.gmail.com> (Martin Ratinaud's message of "Mon, 16 Dec 2019 17:36:40 +0400")

Martin Ratinaud <martinratinaud@gmail.com> 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@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sox-users

  reply index

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-11 14:26 Martin Ratinaud
2019-12-11 17:18 ` Jeremy Nicoll - ml sox users
2019-12-12  4:18   ` Martin Ratinaud
2019-12-12 17:05     ` Jeremy Nicoll - ml sox users
2019-12-16  5:10       ` Martin Ratinaud
2019-12-16 11:48 ` Måns Rullgård
2019-12-16 12:02   ` Martin Ratinaud
2019-12-16 13:30     ` Måns Rullgård
2019-12-16 13:36       ` Martin Ratinaud
2019-12-16 17:44         ` Måns Rullgård [this message]
2019-12-17 10:04           ` Martin Ratinaud
2019-12-17 10:50             ` Måns Rullgård
2019-12-18  4:00               ` Martin Ratinaud
2019-12-18  7:43                 ` Mikko Olkkonen
2019-12-18  9:06                   ` Martin Ratinaud
2019-12-19  9:52                     ` Mikko Olkkonen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.sourceforge.net/lists/listinfo/sox-users

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yw1ximmgw4fh.fsf@mansr.com \
    --to=sox-users@lists.sourceforge.net \
    --cc=martinratinaud@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

sox-users@lists.sourceforge.net unofficial mirror

Archives are clonable: git clone --mirror https://public-inbox.org/sox-users

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.audio.sox
	nntp://ou63pmih66umazou.onion/inbox.comp.audio.sox
	nntp://news.gmane.io/gmane.comp.audio.sox

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git