3

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.

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

1 Answer 1

4

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 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.