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
/usr/local/Cellar/sox/14.4.2_3 (23 files, 1.8MB) *
Poured from bottle on 2019-05-17 at 16:19:01
==> Dependencies
Build: pkg-config ✔
Required: flac ✘, lame ✔, libpng ✔, libsndfile ✔, libvorbis ✔, mad ✔, opusfile ✘
==> 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 = 7938000 samples = 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 = 7938000 samples = 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'
Duration : 00:03:00.04 = 7939544 samples = 13502.6 CDDA sectors
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 = 7938000 samples = 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 = 7938000 samples = 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
still gives
Input File : 'vocals-V3.mp3'
Channels : 2
Sample Rate : 44100
Precision : 16-bit
Duration : 00:03:00.04 = 7939544 samples = 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 = 7938000 samples = 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 = 7938000 samples = 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 = 0.001929
Input File : 'vocals-V4.mp3'
Channels : 2
Sample Rate : 44100
Precision : 16-bit
Duration : 00:03:00.04 = 7939544 samples = 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 = 7939544 samples = 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 = 7938397 samples = 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
-----------------------------------------------------------------------