Reduce audio file size by percentage with SOX

I would like to reduce the volume of the audio file by 10% (so that the new volume will be 90% of the original). How can this be done with SOX? According to the SOX manual, it supports volume parameter:

-v, -volume FACTOR

Adjust the volume in the FACTOR factor. This is a linear (amplitude) setting, so a number less than 1 reduces the volume; more than 1 increases it. If a negative number is given, then in addition to adjusting the volume, the sound will be inverted.

Does this mean that the sox -v 0.9 audio.wav audio.wav will give me an audio file 90% of the original?

+7
sox
source share
1 answer

It seems right that

 sox -v 0.9 in.wav out.wav 

will provide you with an audio file with 90% of the original volume.

stat will show this when you compare the output values Maximum amplitude and Minimum amplitude .

 sox in.wav tmp.wav stat sox out.wav tmp.wav stat 

Please note that using the same file for the input and output file will result in a broken file.

+9
source share

All Articles