I wanted to analyze 5 seconds of an audio file beginning from 50 seconds.

So I ran the following command:

sox audio.wav -n stat trim 50 5

But the output contained:

Length (seconds):     55.296000

But I expected only 5 seconds, not 55.

What did I do wrong? I thought that 50 was the start and 5 - the duration.

  • @dirkt: No, the second argument is a relative position unless it is prefixed by =
    – Thor
    Jun 30, 2017 at 10:09

1 Answer 1


The effects function as a chain, so the stat effect feeds into trim, swap them around and it will work, e.g.:

sox audio.wav -n trim 50 5 stat

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.