Speed Up Playback of a List of Audio Files

To change the playback speed of audio files, we can use the extremely versatile ffmpeg:
ffmpeg -i input.mp3 -filter_complex "[0:a]atempo=1.5[a]" -map "[a]" output.mp3

The number after the atempo flag sets the playback speed. Currently, it’s set to 1.5x the original speed.

In my project, I actually needed to merge about a dozen MP3 files and then change the playback speed of the resulting larger MP3 file.

For convenience, I placed all MP3 files into a single folder, then ran mp3wrap on them:
cd Folder/
mp3wrap input.mp3 *.mp3

The result is called input.mp3 because that’s what I used in the ffmpeg command above.

Now, should you need to change the playback speed of a list of audio files and keep them separate, all you need is a for loop:
for file in *.mp3; do ffmpeg -i $file -filter_complex "[0:a]atempo=1.5[a]" -map "[a]" "${file:0:-4}"-output.mp3; done

The resulting file name will change from audiofile.mp3 to audiofile-output.mp3.

Leave a Reply

Your email address will not be published. Required fields are marked *