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.3 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,MIME_HTML_MOSTLY,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,URIBL_BLOCKED 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 56DCB1F463 for ; Thu, 12 Dec 2019 04:19:29 +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 1ifFwe-0001pE-0y; Thu, 12 Dec 2019 04:19:20 +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 1ifFwb-0001p5-9F for sox-users@lists.sourceforge.net; Thu, 12 Dec 2019 04:19:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Type:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Sender:Reply-To:Cc: 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=+JPl4kYsiYYYjUAvAEk5+0xHybUam1LirDqPXt8v/wo=; b=L7GlYm9h+qsk3ueL1Q6HOJva+ CESSMz7q3S9AeZ3mrOdGaA9GsEJt3AOxzEp1g26YD422D4rDatuxpk32jJD+CuuaCr3qRsI5oym58 1gXul9xK2P5ERbWjFVNhx+nNNNh7phkgAPnzyzA8KAJTtxFdvqu23vpMcrR7h2alVGemk=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To:References: MIME-Version:Sender:Reply-To:Cc: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=+JPl4kYsiYYYjUAvAEk5+0xHybUam1LirDqPXt8v/wo=; b=JKvGKL2Uytb0CuOO+deF7/yFGE LeiuUTWPIa4wUfY8oXJCA3Wgyu6RQ2nZpSBOZVHiwwhZOZzbqAfFsxKfMt8rf3yyTQxfyRiBULu45 iY9ImCatPuw3d4XOsj4Y3Qu8k98oCylS9S7xgN6pwrxzrTRhMABAPB3kR/+pMVNFIMKs=; Received: from mail-qv1-f41.google.com ([209.85.219.41]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.2) id 1ifFwZ-009NRB-08 for sox-users@lists.sourceforge.net; Thu, 12 Dec 2019 04:19:17 +0000 Received: by mail-qv1-f41.google.com with SMTP id p2so411885qvo.10 for ; Wed, 11 Dec 2019 20:19:14 -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; bh=+JPl4kYsiYYYjUAvAEk5+0xHybUam1LirDqPXt8v/wo=; b=ldOnRO3RcBR8CbUJFDFQD/u3F1yIEvXtNLimE+f1Ks1I/OZ8IrvX6ugIEqgqf9IkVp U2bX3qfIGcI3PHiXzTZHsIpeshs5fY75/EHDzglOXwnJwCfnsJdbMToz/6Wvis//oWy5 F5YfxJy5MRd/zewp+zUroMGPSPZ2itNBMUjj38sRpb+nNzlNQx6yM/nalpfleIse3lwc P80mPZ2cd9c6ofVZvgefjmaUemG4ihSMXQrpHWu/jWJmNwNqufoqmQ5E5lbcNsni/PDP puUqWzCFHogC/KVgnRxdIKbzq2HWLzgriSFvdflevP7aVN3OvruBn/Aexbusj1otoo0D cpYg== 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; bh=+JPl4kYsiYYYjUAvAEk5+0xHybUam1LirDqPXt8v/wo=; b=bV4UGLtvmF5W6Aj8uyfQNAzBHfGTctSR/gI/ALUdhmAnzLcwAelLGWBZ+ZIhoZgKD6 5Ze8FxYENufAdFL/WDJ87+4XeZZUCQYixkPNio4y2cqOtoqb8V/A9gwObcEAWlIxRaOj K+6dMk7GjGojyaqZX2Lke5f2zIhevbOQHaPQe5fLBeET/f1M4UoSoQV52YtVP88rmubX q/ZmRxAHkrIIALeozcBV1mVBh22Q6/Z/Xh0jB55tzKbRhufyv/LR5ccJuXF9Ghk/4QV1 x+OD8z26WvFH7vu9BaA+56UkcEgdldpvTFIvRyhWs7604A0R51vnxnLRHGAmoyrFmxNl JiZQ== X-Gm-Message-State: APjAAAXLXBURP9noWX2vCm/JGWJUCRiko5CfGiEJ8yBz2syIQRZIwqqT cUE0Gsh1dXZZVoDFBEShe/+hIdoKXX72xOWpk4ZnMbI5Zg== X-Google-Smtp-Source: APXvYqwCdu2py5gOM0SAZI7Kp01/Raw1P52nx7rJjZEKPLfGW/BylXyLIo0ekEcdxFhFpMDeDOo8NhXhGQV7g3Vgoe4= X-Received: by 2002:a0c:8d4b:: with SMTP id s11mr6249719qvb.244.1576124348395; Wed, 11 Dec 2019 20:19:08 -0800 (PST) MIME-Version: 1.0 References: <6b2ed34b929889fb655800973e7e030e@wingsandbeaks.org.uk> In-Reply-To: <6b2ed34b929889fb655800973e7e030e@wingsandbeaks.org.uk> From: Martin Ratinaud Date: Thu, 12 Dec 2019 08:18:42 +0400 Message-ID: To: sox-users@lists.sourceforge.net X-Headers-End: 1ifFwZ-009NRB-08 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 Content-Type: multipart/mixed; boundary="===============2299602717989280750==" Errors-To: sox-users-bounces@lists.sourceforge.net --===============2299602717989280750== Content-Type: multipart/alternative; boundary="000000000000e874d405997a0b7b" --000000000000e874d405997a0b7b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Jeremy and thanks for the quick answer (and sorry for the not very precise report) - I'm on OSX Mojave 10.14.6 - sox has been installed through brew `brew install sox` - `sox --version` gives `sox: SoX v` - `brew info sox`gives ``` sox: stable 14.4.2 (bottled) SOund eXchange: universal sound sample translator https://sox.sourceforge.io/ /usr/local/Cellar/sox/14.4.2_3 (23 files, 1.8MB) * Poured from bottle on 2019-05-17 at 16:19:01 From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/sox.rb =3D=3D> Dependencies Build: pkg-config =E2=9C=94 Required: flac =E2=9C=98, lame =E2=9C=94, libpng =E2=9C=94, libsndfile =E2= =9C=94, libvorbis =E2=9C=94, mad =E2=9C=94, opusfile =E2=9C=98 =3D=3D> Analytics install: 2,592 (30 days), 7,521 (90 days), 36,263 (365 days) install-on-request: 2,436 (30 days), 7,051 (90 days), 32,403 (365 days) build-error: 0 (30 days) ``` - SOX_OPTS is empty when I `echo $SOX_OPTS` If I launch ``` sox -V3 vocals.wav vocals-V3.mp3 ``` I get ``` sox: SoX v sox INFO formats: detected file format type `wav' Input File : 'vocals.wav' Channels : 2 Sample Rate : 44100 Precision : 16-bit Duration : 00:03:00.00 =3D 7938000 samples =3D 13500 CDDA sectors File Size : 31.8M Bit Rate : 1.41M Sample Encoding: 16-bit Signed Integer PCM Endian Type : little Reverse Nibbles: no Reverse Bits : no sox INFO sox: Overwriting `vocals-V3.mp3' sox INFO mp3: using MP3 encoding defaults Output File : 'vocals-V3.mp3' Channels : 2 Sample Rate : 44100 Precision : 24-bit Duration : 00:03:00.00 =3D 7938000 samples =3D 13500 CDDA sectors Sample Encoding: MPEG audio (layer I, II or III) Comment : 'Processed by SoX' sox INFO sox: effects chain: input 44100Hz 2 channels sox INFO sox: effects chain: output 44100Hz 2 channels ``` Which seems good but when I do ``` soxi vocals-V3.mp3 ``` I still get a different number of samples and duration ``` Input File : 'vocals-V3.mp3' Channels : 2 Sample Rate : 44100 Precision : 16-bit Duration : 00:03:00.04 =3D 7939544 samples =3D 13502.6 CDDA sectors File Size : 2.88M Bit Rate : 128k Sample Encoding: MPEG audio (layer I, II or III) ``` I notice that the precision is different and if I launch ``` sox -V3 vocals.wav -b 24 vocals-V3.mp3 ``` It ends up with the same result ``` sox: SoX v sox INFO formats: detected file format type `wav' Input File : 'vocals.wav' Channels : 2 Sample Rate : 44100 Precision : 16-bit Duration : 00:03:00.00 =3D 7938000 samples =3D 13500 CDDA sectors File Size : 31.8M Bit Rate : 1.41M Sample Encoding: 16-bit Signed Integer PCM Endian Type : little Reverse Nibbles: no Reverse Bits : no sox WARN formats: mp3 can't encode to 24-bit sox INFO mp3: using MP3 encoding defaults Output File : 'vocals-V3.mp3' Channels : 2 Sample Rate : 44100 Precision : 24-bit Duration : 00:03:00.00 =3D 7938000 samples =3D 13500 CDDA sectors Sample Encoding: MPEG audio (layer I, II or III) Comment : 'Processed by SoX' sox INFO sox: effects chain: input 44100Hz 2 channels sox INFO sox: effects chain: output 44100Hz 2 channels ``` but ``` soxi vocals-V3.mp3 ``` still gives ``` Input File : 'vocals-V3.mp3' Channels : 2 Sample Rate : 44100 Precision : 16-bit Duration : 00:03:00.04 =3D 7939544 samples =3D 13502.6 CDDA sectors File Size : 2.88M Bit Rate : 128k Sample Encoding: MPEG audio (layer I, II or III) ``` Here a try with V4 ```sox -V4 vocals.wav vocals-V4.mp3 && soxi vocals-V4.mp3``` ``` sox: SoX v time: Jan 9 2019 13:31:37 uname: Darwin MBP-de-Martin 18.7.0 Darwin Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.2~2/RELEASE_X86_64 x86_64 compiler: gcc 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5) arch: 1288 48 88 L sox INFO formats: detected file format type `wav' sox DBUG wav: Searching for 66 6d 74 20 sox DBUG wav: WAV Chunk fmt sox DBUG wav: Searching for 64 61 74 61 sox DBUG wav: WAV Chunk data sox DBUG wav: Reading Wave file: Microsoft PCM format, 2 channels, 44100 samp/sec sox DBUG wav: 176400 byte/sec, 4 block align, 16 bits/samp, 31752000 data bytes sox DBUG wav: 7938000 Samps/chans sox DBUG wav: Searching for 4c 49 53 54 Input File : 'vocals.wav' Channels : 2 Sample Rate : 44100 Precision : 16-bit Duration : 00:03:00.00 =3D 7938000 samples =3D 13500 CDDA sectors File Size : 31.8M Bit Rate : 1.41M Sample Encoding: 16-bit Signed Integer PCM Endian Type : little Reverse Nibbles: no Reverse Bits : no sox DBUG mp3: -C option is inf sox INFO mp3: using MP3 encoding defaults Output File : 'vocals-V4.mp3' Channels : 2 Sample Rate : 44100 Precision : 24-bit Duration : 00:03:00.00 =3D 7938000 samples =3D 13500 CDDA sectors Sample Encoding: MPEG audio (layer I, II or III) Comment : 'Processed by SoX' sox INFO sox: effects chain: input 44100Hz 2 channels (multi) 16 bits 00:03:00.00 sox INFO sox: effects chain: output 44100Hz 2 channels (multi) 24 bits 00:03:00.00 sox DBUG sox: start-up time =3D 0.001929 Input File : 'vocals-V4.mp3' Channels : 2 Sample Rate : 44100 Precision : 16-bit Duration : 00:03:00.04 =3D 7939544 samples =3D 13502.6 CDDA sectors File Size : 2.88M Bit Rate : 128k Sample Encoding: MPEG audio (layer I, II or III) ``` And same with V5, V6 etc.. For the trimming I noticed there are 1544 more samples in the resulting mp3 file, so I tried to trim them using this command ``` sox -V3 vocals.mp3 vocals-trimmed.mp3 trim 1544s && soxi vocals-trimmed.mp3 ``` which gives ``` sox: SoX v Input File : 'vocals.mp3' Channels : 2 Sample Rate : 44100 Precision : 16-bit Duration : 00:03:00.04 =3D 7939544 samples =3D 13502.6 CDDA sectors File Size : 2.88M Bit Rate : 128k Sample Encoding: MPEG audio (layer I, II or III) sox INFO sox: Overwriting `vocals-trimmed.mp3' sox INFO mp3: using MP3 encoding defaults Output File : 'vocals-trimmed.mp3' Channels : 2 Sample Rate : 44100 Precision : 24-bit Sample Encoding: MPEG audio (layer I, II or III) Comment : 'Processed by SoX' sox INFO sox: effects chain: input 44100Hz 2 channels sox INFO sox: effects chain: trim 44100Hz 2 channels sox INFO sox: effects chain: output 44100Hz 2 channels Input File : 'vocals-trimmed.mp3' Channels : 2 Sample Rate : 44100 Precision : 16-bit Duration : 00:03:00.01 =3D 7938397 samples =3D 13500.7 CDDA sectors File Size : 2.88M Bit Rate : 128k Sample Encoding: MPEG audio (layer I, II or III) ``` So "it does not work" means, the resulting file is not exactly trimmed of 1544s as expected because there are 1147 left It takes approximately 3s I hope the description is clearer Let me know if I can give you more information Thanks ----------------------------------------------------------------------- *Martin RATINAUD* ----------------------------------------------------------------------- On Wed, Dec 11, 2019 at 9:39 PM Jeremy Nicoll - ml sox users < jn.ml.sxu.88@wingsandbeaks.org.uk> wrote: > On 2019-12-11 14:26, Martin Ratinaud wrote: > > 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 sectors > > 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 secto= rs > > 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 > > > Which version of sox, on what OS? > Did you build the sox binary yourself or download it from somewhere? > > Although you say the command was just > > sox vocals.wav vocals.mp3 > > sox can also incorporate values of environment variables. Is there any > chance that on your OS the command has included any other parameters? > See the 'SOX_OPTS' section of the manual. > > > If you reissue the command, as eg > > sox -V3 vocals.wav vocals002.mp3 > > (or even -V4 or more) do any of the info messsages give any clues? Is > the > result file the same size as your one? > > > > > > If I try to launch `sox -V vocals.mp3 vocals-trimmed.mp3 trim 1544s` it > > does not work > > You'll need to be more precise. What sort of "not work"? Does sox > run? > Does it produce any messages? Is there a result file? How long was it? > > > -- > Jeremy Nicoll - my opinions are my own > > > _______________________________________________ > Sox-users mailing list > Sox-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sox-users > --000000000000e874d405997a0b7b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Jeremy and thanks for the quick answer (and sorry for t= he not very precise report)

- I'm on OSX Mojave=C2= =A010.14.6
- sox has been installed through brew `brew install so= x`
- `sox --version` gives `sox: =C2=A0 =C2=A0 =C2=A0SoX v`=C2=A0=
- `brew info sox`gives
```
sox: stable 14.4.2 (bottled)
SOund eXchange: universal sound sample translator
/u= sr/local/Cellar/sox/14.4.2_3 (23 files, 1.8MB) *
=C2=A0 Poured = from bottle on 2019-05-17 at 16:19:01
= =3D=3D> Dependencies
Build: pkg-config =E2=9C=94
Required: flac =E2=9C=98, lame =E2=9C=94, libpng =E2=9C=94, libsndfile =E2= =9C=94, libvorbis =E2=9C=94, mad =E2=9C=94, opusfile =E2=9C=98
= =3D=3D> Analytics
install: 2,592 (30 days), 7,521 (90 days),= 36,263 (365 days)
install-on-request: 2,436 (30 days), 7,051 (= 90 days), 32,403 (365 days)
build-error: 0 (30 days)
```


- SOX= _OPTS is empty when I `echo $SOX_OPTS`

If I la= unch
<= div>```
sox -V3 vocals.wav vocals-V3.mp3
```

I get=C2=A0
```
sox: =C2=A0 =C2= =A0 =C2=A0SoX v
sox INFO formats: detected file format type `wav'
Input File =C2=A0 =C2=A0 : 'vocals.wav'
Channels =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 : 00:03:00.00 =3D 79380= 00 samples =3D 13500 CDDA sectors
File Size =C2=A0 =C2=A0 =C2=A0: 31.8M<= br>Bit Rate =C2=A0 =C2=A0 =C2=A0 : 1.41M
Sample Encoding: 16-bit Signed = Integer PCM
Endian Type =C2=A0 =C2=A0: little
Reverse Nibbles: no
= Reverse Bits =C2=A0 : no

sox INFO sox: Overwriting `vocals-V3.mp3= 9;
sox INFO mp3: using MP3 encoding defaults

Output File =C2=A0 = =C2=A0: 'vocals-V3.mp3'
Channels =C2=A0 =C2=A0 =C2=A0 : 2
Sam= ple Rate =C2=A0 =C2=A0: 44100
Precision =C2=A0 =C2=A0 =C2=A0: 24-bit
= Duration =C2=A0 =C2=A0 =C2=A0 : 00:03:00.00 =3D 7938000 samples =3D 13500 C= DDA sectors
Sample Encoding: MPEG audio (layer I, II or III)
Comment = =C2=A0 =C2=A0 =C2=A0 =C2=A0: 'Processed by SoX'

sox INFO sox= : effects chain: input =C2=A0 =C2=A0 =C2=A0 =C2=A044100Hz =C2=A02 channels<= br>sox INFO sox: effects chain: output =C2=A0 =C2=A0 =C2=A0 44100Hz =C2=A02= channels
```
Which seems good bu= t when I do
```
soxi vocals-V3.mp3
=
```
I still get a different number o= f samples and duration
```
Input File =C2=A0= =C2=A0 : 'vocals-V3.mp3'
Channels =C2=A0 =C2= =A0 =C2=A0 : 2
Sample Rate =C2=A0 =C2=A0: 44100
<= /div>
Precision =C2=A0 =C2=A0 =C2=A0: 16-bit
= Duration =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 : 128k
Sample Encoding: MPEG audio (layer I, II or III)
```=
I notice that the precision is different= and if I launch

```
sox -V3 = vocals.wav -b 24 vocals-V3.mp3
```
It ends up with the same result
```
sox: =C2=A0 =C2=A0 =C2=A0SoX v<= /div>
sox INFO formats: detected file format type `wav'
<= br>
Input File =C2=A0 =C2=A0 : 'vocals.wav'
Cha= nnels =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 : 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 : 1.41M
Sample Encoding: 16-bit Signed Integer PCM
Endian Type =C2=A0 =C2=A0: little
Reverse Nibbles: no
Reverse Bits =C2=A0 : no

sox WARN formats: m= p3 can't encode to 24-bit
sox INFO mp3: using MP3 encoding de= faults

Output File =C2=A0 =C2=A0: 'vocals-V3.m= p3'
Channels =C2=A0 =C2=A0 =C2=A0 : 2
Sample Rate = =C2=A0 =C2=A0: 44100
Precision =C2=A0 =C2=A0 =C2=A0: 24-bit
=
Duration =C2=A0 =C2=A0 =C2=A0 : 00:03:00.00 =3D 7938000 samples =3D 13= 500 CDDA sectors
Sample Encoding: MPEG audio (layer I, II or III)=
Comment =C2=A0 =C2=A0 =C2=A0 =C2=A0: 'Processed by SoX'<= /div>

sox INFO sox: effects chain: input =C2=A0 =C2=A0 = =C2=A0 =C2=A044100Hz =C2=A02 channels
sox INFO sox: effects chain= : output =C2=A0 =C2=A0 =C2=A0 44100Hz =C2=A02 channels
```
<= /blockquote>but=C2=A0
```
soxi vocals-V3.mp3<= /div>
```
still= gives
```
Input File =C2=A0 =C2=A0 : 'v= ocals-V3.mp3'
Channels =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 : 00:03:00.04 =3D 7939544 samples =3D 13502.6 CDDA sector= s
File Size =C2=A0 =C2=A0 =C2=A0: 2.88M
Bit Rate =C2=A0 =C2=A0 =C2=A0= : 128k
Sample Encoding: MPEG audio (layer I, II or III)
`= ``

Here a try with V4 ```sox -V4 vocals.wa= v vocals-V4.mp3 && soxi vocals-V4.mp3```

```
sox: =C2=A0 =C2=A0 =C2=A0SoX v
time: =C2=A0 =C2=A0 Jan =C2=A09 = 2019 13:31:37
uname: =C2=A0 =C2=A0Darwin MBP-de-Martin 18.7.0 Dar= win Kernel Version 18.7.0: Tue Aug 20 16:57:14 PDT 2019; root:xnu-4903.271.= 2~2/RELEASE_X86_64 x86_64
compiler: gcc 4.2.1 Compatible Apple LL= VM 10.0.0 (clang-1000.11.45.5)
arch: =C2=A0 =C2=A0 1288 48 88 L
sox INFO formats: detected file format type `wav'
so= x DBUG wav: Searching for 66 6d 74 20
sox DBUG wav: WAV Chunk fmt=
sox DBUG wav: Searching for 64 61 74 61
sox DBUG wav: = WAV Chunk data
sox DBUG wav: Reading Wave file: Microsoft PCM for= mat, 2 channels, 44100 samp/sec
sox DBUG wav: =C2=A0 =C2=A0 =C2= =A0 =C2=A0 176400 byte/sec, 4 block align, 16 bits/samp, 31752000 data byte= s
sox DBUG wav: =C2=A0 =C2=A0 =C2=A0 =C2=A0 7938000 Samps/chans
sox DBUG wav: Searching for 4c 49 53 54

I= nput File =C2=A0 =C2=A0 : 'vocals.wav'
Channels =C2=A0 = =C2=A0 =C2=A0 : 2
Sample Rate =C2=A0 =C2=A0: 44100
Prec= ision =C2=A0 =C2=A0 =C2=A0: 16-bit
Duration =C2=A0 =C2=A0 =C2=A0 = : 00:03:00.00 =3D 7938000 samples =3D 13500 CDDA sectors
File Siz= e =C2=A0 =C2=A0 =C2=A0: 31.8M
Bit Rate =C2=A0 =C2=A0 =C2=A0 : 1.4= 1M
Sample Encoding: 16-bit Signed Integer PCM
Endian Ty= pe =C2=A0 =C2=A0: little
Reverse Nibbles: no
Reverse Bi= ts =C2=A0 : no

sox DBUG mp3: -C option is inf
sox INFO mp3: using MP3 encoding defaults

Ou= tput File =C2=A0 =C2=A0: 'vocals-V4.mp3'
Channels =C2=A0 = =C2=A0 =C2=A0 : 2
Sample Rate =C2=A0 =C2=A0: 44100
Prec= ision =C2=A0 =C2=A0 =C2=A0: 24-bit
Duration =C2=A0 =C2=A0 =C2=A0 = : 00:03:00.00 =3D 7938000 samples =3D 13500 CDDA sectors
Sample E= ncoding: MPEG audio (layer I, II or III)
Comment =C2=A0 =C2=A0 = =C2=A0 =C2=A0: 'Processed by SoX'

sox INFO= sox: effects chain: input =C2=A0 =C2=A0 =C2=A0 =C2=A044100Hz =C2=A02 chann= els (multi) 16 bits 00:03:00.00
sox INFO sox: effects chain: outp= ut =C2=A0 =C2=A0 =C2=A0 44100Hz =C2=A02 channels (multi) 24 bits 00:03:00.0= 0
sox DBUG sox: start-up time =3D 0.001929

Input File =C2=A0 =C2=A0 : 'vocals-V4.mp3'
Channels = =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 : 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 : 128k
Sample Encoding: MPEG audio (layer I, II or III)
=
```

And same with V5, V6 et= c..

For=C2=A0 the trimming
I noticed there ar= e 1544 more samples in the resulting mp3 file, so I tried to trim them usin= g this command

```
sox -V3 vocals.mp3 vocals-trimme= d.mp3 trim 1544s && soxi vocals-trimmed.mp3
```

which gives

```
sox: = =C2=A0 =C2=A0 =C2=A0SoX v

Input File =C2=A0 =C2=A0= : 'vocals.mp3'
Channels =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 : 00:03:00.04 =3D 79395= 44 samples =3D 13502.6 CDDA sectors
File Size =C2=A0 =C2=A0 =C2= =A0: 2.88M
Bit Rate =C2=A0 =C2=A0 =C2=A0 : 128k
Sample = Encoding: MPEG audio (layer I, II or III)

sox INFO= sox: Overwriting `vocals-trimmed.mp3'
sox INFO mp3: using MP= 3 encoding defaults

Output File =C2=A0 =C2=A0: = 9;vocals-trimmed.mp3'
Channels =C2=A0 =C2=A0 =C2=A0 : 2
=
Sample Rate =C2=A0 =C2=A0: 44100
Precision =C2=A0 =C2=A0 =C2= =A0: 24-bit
Sample Encoding: MPEG audio (layer I, II or III)
Comment =C2=A0 =C2=A0 =C2=A0 =C2=A0: 'Processed by SoX'
=

sox INFO sox: effects chain: input =C2=A0 =C2=A0 =C2=A0= =C2=A044100Hz =C2=A02 channels
sox INFO sox: effects chain: trim= =C2=A0 =C2=A0 =C2=A0 =C2=A0 44100Hz =C2=A02 channels
sox INFO so= x: effects chain: output =C2=A0 =C2=A0 =C2=A0 44100Hz =C2=A02 channels

Input File =C2=A0 =C2=A0 : 'vocals-trimmed.mp3'= ;
Channels =C2=A0 =C2=A0 =C2=A0 : 2
Sample Rate =C2=A0 = =C2=A0: 44100
Precision =C2=A0 =C2=A0 =C2=A0: 16-bit
Du= ration =C2=A0 =C2=A0 =C2=A0 : 00:03:00.01 =3D 7938397 samples =3D 13500.7 C= DDA sectors
File Size =C2=A0 =C2=A0 =C2=A0: 2.88M
Bit R= ate =C2=A0 =C2=A0 =C2=A0 : 128k
Sample Encoding: MPEG audio (laye= r I, II or III)
```

So &quo= t;it does not work" means, the resulting file is not exactly trimmed o= f 1544s as expected because there are 1147 left

It takes= approximately 3s=C2=A0

I hope the description is = clearer=C2=A0
Let me know if I can give you more information

Thanks

-----------------------------------------------= ------------------------
Martin RATINAUD
--------------------------= ---------------------------------------------

<= /div>

On Wed, Dec 11, 2019 at 9:39 PM Jeremy Nicoll - ml sox users <jn.ml.sxu.88@wingsandbeaks.= org.uk> wrote:
On 2019-12-11 14:26, Martin Ratinaud wrote:
> 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-tes= t/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-tes= t/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 <= br> > number
> of samples also changed.
> In fact, 1544 samples have been added to the beginning of the file


Which version of sox, on what OS?
Did you build the sox binary yourself or download it from somewhere?

Although you say the command was just

=C2=A0 =C2=A0sox vocals.wav vocals.mp3

sox can also incorporate values of environment variables.=C2=A0 Is there an= y
chance that on your OS the command has included any other parameters?
See the 'SOX_OPTS' section of the manual.


If you reissue the command, as eg

=C2=A0 =C2=A0sox -V3 vocals.wav vocals002.mp3

(or even -V4 or more) do any of the info messsages give any clues?=C2=A0 Is=
the
result file the same size as your one?




> If I try to launch `sox -V vocals.mp3 vocals-trimmed.mp3 trim 1544s` i= t
> does not work

You'll need to be more precise.=C2=A0 What sort of "not work"= ?=C2=A0 =C2=A0Does sox
run?
Does it produce any messages?=C2=A0 Is there a result file?=C2=A0 How long = was it?


--
Jeremy Nicoll - my opinions are my own


_______________________________________________
Sox-users mailing list
Sox-us= ers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/s= ox-users
--000000000000e874d405997a0b7b-- --===============2299602717989280750== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline --===============2299602717989280750== 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 --===============2299602717989280750==--