From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS6130 216.105.38.0/24 X-Spam-Status: No, score=-3.4 required=3.0 tests=AWL,BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id EE09F1F463 for ; Mon, 16 Dec 2019 13:37:22 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.90_1) (envelope-from ) id 1igqYn-0006ki-5D; Mon, 16 Dec 2019 13:37:17 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1igqYl-0006kZ-1o for sox-users@lists.sourceforge.net; Mon, 16 Dec 2019 13:37:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Sender:Reply-To:Content-Transfer-Encoding :Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=/fgyOujkW8yD20REJZXhG5+8J/pWidXM2pLU3CNQGlE=; b=bERWmmXIczYITOoJCSwpRwI+1K sEVxZ6dM8okb1VWoXqCwKuPTLfyNT/CyJX74JlpfOdSmiWQvpwETLvrxzptFKXb9EOnJXYEiRQLsh enSd0nE0DNhyK3MI1AFVXctgDqVH/+q41JgwdOoZAMxj1Qr7FSgxNs+M9ACIyXUsGL6k=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:Cc:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=/fgyOujkW8yD20REJZXhG5+8J/pWidXM2pLU3CNQGlE=; b=kRA8NZ3vuqgYhOd8zp5ylG7Emi 7Tn1OednpybxkAiuX1ygUAKYK1kYg6/rvnoOrC1iHkgnFxZ+Ww5sLZleCFEftax3p7WOYy9fixhIY Ku9UaYrlo9RfZIsKegYc7JQRssmecFvWvVXdEtyNJbQMkqXwEJGn1YllRIBQOCnd1kqI=; Received: from mail-qk1-f175.google.com ([209.85.222.175]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) id 1igqYj-00EwAB-C3 for sox-users@lists.sourceforge.net; Mon, 16 Dec 2019 13:37:15 +0000 Received: by mail-qk1-f175.google.com with SMTP id r14so4731438qke.13 for ; Mon, 16 Dec 2019 05:37:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/fgyOujkW8yD20REJZXhG5+8J/pWidXM2pLU3CNQGlE=; b=TB/8RJsoQJXUlgr09W+WMStWJGCxAHvENrNUW9gfWcN1+CofWZ16qJPUZV8Pn7Ooc6 WEWfNlPmbEutL0G07CT7boQMIs+eNE7Xfd8jFxIdRYuaa82laTrTonrT7unB9ZAX4dET xvz+Z8fOiCoReqyjv7XRMoceMEB/OL8JadDdbkwTM9DJtoG5nrZGEywh44K3tgXnbYAV q2yNgXAZ2i6vd5/tVbuaeFf2o8T+Pxb+N1zeWsl82lAczUB2EpDDfaltiCRPWsIOddBB aCTVKct22A9D7WFC1OZoyJKE7jXcYuVtG+1UVAwpgY18Kjl6we8PR/AVC5YJSX9pOUj8 HxgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/fgyOujkW8yD20REJZXhG5+8J/pWidXM2pLU3CNQGlE=; b=VnJjdaGVJvaGv3KxoZqEFTrWH7z3EIdNfKjS5V5uGqYnLybTuS5Rt7tlKaFTNED4jJ +a5bsmiPBNcKrA3A4HxZ4FKyR5HSiLURwz6RJprb0rGd7vvL0e6XduU8IV9jxWIb+ktO hAkJfEFTE//gjfuTetvO2YxD1uE962WowO6NNabIEf7lv8XNBxSjLS4Zv0eMR0YCivaj +Vz/8tZXP59srZqbNq4P6uO5Mjo0X1Ylx0kdDowHK0R0ylzsyIgtjAk/Kpo50l8Isk5u XyHi6F0xGucpMQ1nbQ3VY3yccu4e8ZCdSsUhaOKCtcU3JO1I8nF2GzLrI3/iB+dEATp9 EMuA== X-Gm-Message-State: APjAAAXF1/Zq9zzFOcVuE8H6N8rwrXThNudfoSAFCMh72tGzaTN6aBFs kVddhjpknbXOYKInITXcZ1qLojgJRBouOFMD6g== X-Google-Smtp-Source: APXvYqzZMxWL6uKp9FxgOkSevE//trf6FESKEvTvNOICrpdURrAfF3eqhKyzwYr+Mn3h8ctz4CPhD2tclPPA8dMArQc= X-Received: by 2002:ae9:c011:: with SMTP id u17mr26417598qkk.480.1576503427074; Mon, 16 Dec 2019 05:37:07 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Martin Ratinaud Date: Mon, 16 Dec 2019 17:36:40 +0400 Message-ID: To: =?UTF-8?B?TcOlbnMgUnVsbGfDpXJk?= X-Headers-End: 1igqYj-00EwAB-C3 Subject: Re: Wav to Mp3 leads to an mp3 file that has a longer duration X-BeenThere: sox-users@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sox-users@lists.sourceforge.net Cc: sox-users@lists.sourceforge.net Content-Type: multipart/mixed; boundary="===============6960517025390899295==" Errors-To: sox-users-bounces@lists.sourceforge.net --===============6960517025390899295== Content-Type: multipart/alternative; boundary="000000000000c20f540599d24e19" --000000000000c20f540599d24e19 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 =3D 7500 * 1152 and when I convert it to an mp3, I get 8641152 samples Thanks again for your insights ----------------------------------------------------------------------- *Martin RATINAUD* ----------------------------------------------------------------------- On Mon, Dec 16, 2019 at 5:30 PM M=C3=A5ns Rullg=C3=A5rd wr= ote: > Martin Ratinaud writes: > > > Hi M=C3=A5ns and thanks very much > > > > Though it seems the resulting file is 7939544 samples > > > > and 7939544 / 1152 =3D 6891.965277777777 > > > > So it's not a multiple of 1152 unless I'm missing something ? > > That difference is due to a rounding error in the stream length > calculation. > > > On Mon, Dec 16, 2019 at 3:48 PM M=C3=A5ns Rullg=C3=A5rd wrote: > > > >> Martin Ratinaud writes: > >> > >> > Hi all, > >> > > >> > I'm converting a file called vocals.wav to vocals.mp3 > >> > vocals.wav > >> > < > >> > https://drive.google.com/file/d/1he1eCJag1G8iGkgL932jy_mXuLT_khGM/view?us= p=3Ddrive_web > >> > > >> > For this I'm using this command > >> > > >> > ``` > >> > sox vocals.wav vocals.mp3 > >> > ``` > >> > and here is the result of the corresponding files > >> > > >> > - original file > >> > ``` > >> > soxi /Users/martin/Downloads/split-test/vocals.wav > >> > > >> > Input File : '/Users/martin/Downloads/split-test/vocals.wav' > >> > Channels : 2 > >> > Sample Rate : 44100 > >> > Precision : 16-bit > >> > Duration : 00:03:00.00 =3D 7938000 samples =3D 13500 CDDA sect= ors > >> > File Size : 31.8M > >> > Bit Rate : 1.41M > >> > Sample Encoding: 16-bit Signed Integer PCM > >> > ``` > >> > > >> > - converted file > >> > ``` > >> > soxi /Users/martin/Downloads/split-test/vocals.mp3 > >> > > >> > Input File : '/Users/martin/Downloads/split-test/vocals.mp3' > >> > Channels : 2 > >> > Sample Rate : 44100 > >> > Precision : 16-bit > >> > Duration : 00:03:00.04 =3D 7939544 samples =3D 13502.6 CDDA se= ctors > >> > File Size : 2.88M > >> > Bit Rate : 128k > >> > Sample Encoding: MPEG audio (layer I, II or III) > >> > ``` > >> > > >> > You can see that the duration is not the same which is weird and the > number > >> > of samples also changed. > >> > In fact, 1544 samples have been added to the beginning of the file > >> > > >> > If I try to launch `sox -V vocals.mp3 vocals-trimmed.mp3 trim 1544s` > it > >> > does not work > >> > >> MP3 files have to have a multiple of 1152 samples. This can't be > >> avoided. If the input isn't such a multiple, it will be padded by the > >> encoder. > >> > >> > > > > _______________________________________________ > > Sox-users mailing list > > Sox-users@lists.sourceforge.net > > https://lists.sourceforge.net/lists/listinfo/sox-users > > > > -- > M=C3=A5ns Rullg=C3=A5rd > --000000000000c20f540599d24e19 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Ok, thanks.=C2=A0

But would it be possi= ble to=C2=A0
- 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 duratio= n and mp3 duration

Because I just test with a wav = file that is=C2=A08640000 samples =3D 7500 * 1152
and when I conv= ert it to an mp3, I get=C2=A08641152 samples

Thank= s again for your insights


<= div dir=3D"ltr" class=3D"gmail_signature" data-smartmail=3D"gmail_signature= ">----------------------------------= -------------------------------------
Martin RATINAUD
-------------= ----------------------------------------------------------


On Mon, Dec 16, 2019 at 5:30 PM M=C3=A5ns Rullg=C3=A5rd <mans@mansr.com> wrote:
Martin Ratinaud <martinratinaud@gmail.co= m> writes:

> Hi M=C3=A5ns and thanks very much
>
> Though it seems the resulting file is 7939544 samples
>
> and 7939544 / 1152 =3D 6891.965277777777
>
> So it's not a multiple of 1152 unless I'm missing something ?<= br>
That difference is due to a rounding error in the stream length
calculation.

> On Mon, Dec 16, 2019 at 3:48 PM M=C3=A5ns Rullg=C3=A5rd <mans@mansr.com> wrote:
>
>> Martin Ratinaud <martinratinaud@gmail.com> writes:
>>
>> > Hi all,
>> >
>> > I'm converting a file called vocals.wav to vocals.mp3
>> >=C2=A0 vocals.wav
>> > <
>> https= ://drive.google.com/file/d/1he1eCJag1G8iGkgL932jy_mXuLT_khGM/view?usp=3Ddri= ve_web
>> >
>> > For this I'm using this command
>> >
>> > ```
>> > sox vocals.wav vocals.mp3
>> > ```
>> > and here is the result of the corresponding files
>> >
>> > - original file
>> > ```
>> > soxi /Users/martin/Downloads/split-test/vocals.wav
>> >
>> > Input File=C2=A0 =C2=A0 =C2=A0: '/Users/martin/Downloads/= split-test/vocals.wav'
>> > Channels=C2=A0 =C2=A0 =C2=A0 =C2=A0: 2
>> > Sample Rate=C2=A0 =C2=A0 : 44100
>> > Precision=C2=A0 =C2=A0 =C2=A0 : 16-bit
>> > Duration=C2=A0 =C2=A0 =C2=A0 =C2=A0: 00:03:00.00 =3D 7938000 = samples =3D 13500 CDDA sectors
>> > File Size=C2=A0 =C2=A0 =C2=A0 : 31.8M
>> > Bit Rate=C2=A0 =C2=A0 =C2=A0 =C2=A0: 1.41M
>> > Sample Encoding: 16-bit Signed Integer PCM
>> > ```
>> >
>> > - converted file
>> > ```
>> > soxi /Users/martin/Downloads/split-test/vocals.mp3
>> >
>> > Input File=C2=A0 =C2=A0 =C2=A0: '/Users/martin/Downloads/= split-test/vocals.mp3'
>> > Channels=C2=A0 =C2=A0 =C2=A0 =C2=A0: 2
>> > Sample Rate=C2=A0 =C2=A0 : 44100
>> > Precision=C2=A0 =C2=A0 =C2=A0 : 16-bit
>> > Duration=C2=A0 =C2=A0 =C2=A0 =C2=A0: 00:03:00.04 =3D 7939544 = samples =3D 13502.6 CDDA sectors
>> > File Size=C2=A0 =C2=A0 =C2=A0 : 2.88M
>> > Bit Rate=C2=A0 =C2=A0 =C2=A0 =C2=A0: 128k
>> > Sample Encoding: MPEG audio (layer I, II or III)
>> > ```
>> >
>> > You can see that the duration is not the same which is weird = and the number
>> > of samples also changed.
>> > In fact, 1544 samples have been added to the beginning of the= file
>> >
>> > If I try to launch `sox -V vocals.mp3 vocals-trimmed.mp3 trim= 1544s` it
>> > does not work
>>
>> MP3 files have to have a multiple of 1152 samples.=C2=A0 This can&= #39;t be
>> avoided.=C2=A0 If the input isn't such a multiple, it will be = padded by the
>> encoder.
>>
>>
>
> _______________________________________________
> Sox-users mailing list
> S= ox-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listi= nfo/sox-users
>

--
M=C3=A5ns Rullg=C3=A5rd
--000000000000c20f540599d24e19-- --===============6960517025390899295== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============6960517025390899295== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Sox-users mailing list Sox-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sox-users --===============6960517025390899295==--