Change the amplitude (volume) of an audio file

Purpose. Change the amplitude (volume) of an audio file.

Usage. 

java AmplitudeConverter -h

java AmplitudeConverter [[ --lin ] | [ --log ]] amplitude sourcefile targetfile

Parameters. 

-h

displays help message

--lin

the amplitude will be given in a linear scale

--log

the amplitude will be given in a logarithmic scale

amplitude

the amplitude to apply to the audio data. If --lin is chosen, this is a simple factor, e.g. 2.0 to double te amplitude. If --log is chosen, this is a value in dB, e.g. 6.0 to double the amplitude.

sourcefile

the file name of the audio file that should be read

targetfile

the file name of the audio file that should be written

Bugs, limitations. You need the DSP package from Tritonus to compile and run this example.

Source code.  AmplitudeConverter.java, Tritonus DSP package