How do I have to call sox to transform an 2 second audio file into being speed up so that the resulting length of the file is 1.5 seconds (75%)? Do I have to pass an argument to do pitch correction? What arguments do I have to pass that the filesize stays small?
Asked
Active
Viewed 1.1k times
2 Answers
29
Try this (with input.wav as your input file)
sox input.wav output.wav speed 1.33
Taken from this, its example 13.
Regarding pitch correction, if the pitch should stay the same, use this command instead.
sox input.wav output.wav tempo 1.33
Regarding filesize. It depends on the audio format you want to use. If it is compressed, select settings for higher compression. If not, you may want to convert it to mono, reduce the sample rate or bits.
-
3I believe the second example should be `sox input.wav output.wav tempo 1.33`. – Ethan Koenig Aug 04 '18 at 02:38
-
In case anyone is confused like I was, the **speed is increased** by the factor **1.33**, the header question is not worded clearly, asking for reduction of speed. Just in case someone did not read the full question like me. – Epanemu Jul 28 '21 at 08:27
-
@Epanemu since I have edit rights by now, I changed the header question to clear up things – 576i Jul 30 '21 at 22:07
12
I just tried slowing down a typical CD-quality audio file with sox and ffmpeg for a side-by-side comparison of changing tempo without changing pitch.
It appears that sox introduced some stutter that ffmpeg did not. Would recommend ffmpeg, for slowing at least; here at half-tempo:
ffmpeg -i file.mp3 -filter:a "atempo=0.5" file_0.5.mp3

poobear
- 121
- 1
- 2