May 22

Add volume gain to multiple files in a directory

Category: multimedia   — Published by goeszen on May 22, 2017 at 3:50 pm

I had a number of .m4a files which I wanted to burn on a CD. The thing is that I was mixing these files with a few other .wav files from elsewhere which had a very different (actually a proper) audio level. The bunch of files in the first dir were all levelled too low.

Here's a quick shell one-liner to process all files in one dir with avconv/ffmpeg to add volume:

$ for f in *.m4a; do avconv -i "$f" -af "volume=volume=6dB" -f wav "out/$f.wav"; done

Make sure the ./out sub-directory exists before running this.

Explanation: I use avconv to process all .m4a files in a directory, using the audio filter (-af) facility to add 6dB of volume.

This here uses the same for/do/done shell loop as I used in batch processing a whole dir with AtomicParsley.

For keywords:
process whole dir with avconv
raise volume on multiple files
add gain to audio files with ffmpeg
batch-process directory of audio files

Leave a Reply