When trimming the wav file (16 kHz/16 bits), sox is dropping some of the frames. In the end the total duration of slices is less than original duration. More details in the log attached.
Some code to reproduce the problem:
# Generating the sweep sine sox -r 16000 -c 1 -b 16 -n sweep.wav synth 3133920s sine 10:8000 soxi sweep.wav | grep Duration # >> Duration : 00:03:15.87 = 3133920 samples ~ 14690.2 CDDA sectors # Slicing into 10 second chunks sox sweep.wav slice_.wav trim 0 10 : newfile : restart soxi slice_* | grep Total # >> Total Duration of 20 files: 00:03:11.31 # Merging back sox slice_0* sweep_merged.wav soxi sweep_merged.wav | grep Duration # >> Duration : 00:03:11.31 = 3060960 samples ~ 14348.2 CDDA sectors
It can be seen that there is approximately 4.5 second of data missing. Discontinuities are also visible on the spectrogram.
Original:
Merged:
This sounds like something that was fixed in SoX 14.4.0. What version do you use?
I am using v14.3.2 on Ubuntu 12.04. I will try to install in some way the newest version.
Indeed, I tried 14.4.1 on my Cygwin and problem doesn't exist. I guess that ticket can be closed as irrelevant. Thank you Ulrich.