
SoX: How to Change Audio Volume
Updated
Learn how to change the volume of an audio file using SoX

Install SoX
Before we start, make sure you have SoX installed on your computer and an audio file ready in a folder. If you don't have SoX yet, you can install it with Homebrew:
brew install sox
Change the Volume
First, open your terminal and navigate to the folder containing your audio file. The quickest way to change the volume is the -v flag. To double the volume, run this command:
sox -v 2.0 input.wav output.wav
Just swap input.wav with your actual file name. SoX works with MP3 files too. Values above 1.0 make it louder, and values below it, like 0.5, make it quieter. Always give the new file a different name, because SoX overwrites existing files without asking.
If you'd rather work in decibels, put the gain effect at the end instead. For example, gain 6 boosts it by 6 dB and gain -10 turns it down.
Make It as Loud as Possible
To make a quiet file as loud as it can go without clipping, run this command:
sox input.wav output.wav norm -0.1
This finishes almost instantly, and don't worry if you don't see a success message. To make sure everything worked, run play output.wav and have a listen.
If you want to know the biggest safe value for -v, run sox input.wav -n stat -v. SoX prints the exact multiplier you can use without distortion.
