I have lots of mp3 files that were set (by some buggy tool) to such a low gain level, that there is nothing to hear any more.
This command
for f in *.mp3; do sox --norm "$f" /tmp/sox.mp3; mv -v /tmp/sox.mp3 "$f"; resets the volume of all files in the current folder to a normal level, but sox uncompresses and re-compresses lossy formats while processing, so iterated compression will cause slight detoriation of quality.
How do I minimize the additional detoriation while re-encoding? I would use mp3 with a bitrate of 320 for the output file, but I could not find any hint for this in the manual