Menu

#264 sox is losing frames when trimming

closed-out-of-date
nobody
None
7
2015-06-11
2015-06-11
Adrian S
No

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:
original

Merged:
merged

1 Attachments

Discussion

  • Ulrich Klauer

    Ulrich Klauer - 2015-06-11

    This sounds like something that was fixed in SoX 14.4.0. What version do you use?

     
  • Adrian S

    Adrian S - 2015-06-11

    I am using v14.3.2 on Ubuntu 12.04. I will try to install in some way the newest version.

     
  • Adrian S

    Adrian S - 2015-06-11

    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.

     
  • Ulrich Klauer

    Ulrich Klauer - 2015-06-11
    • status: open --> closed-out-of-date
     

Log in to post a comment.