Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I reduce the play time of a voice mp3 file with sox to 75%?

Tags:

sox

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?

like image 533
Christian Avatar asked Nov 27 '15 12:11

Christian


People also ask

How do I change the speed of an mp3?

Open the audio file and select the audio to be changed. On the menu bar, open the “Effects” tab > Change Tempo. A dialogue box will open. Move slider as appropriate.


2 Answers

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.

like image 188
576i Avatar answered Oct 01 '22 17:10

576i


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
like image 26
poobear Avatar answered Oct 01 '22 17:10

poobear