1

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

1

2 Answers 2

2

Have a look at mp3gain, which will (reversibly) change the scale factor in each MP3 frame to adjust the volume. Modifying an MP3 file in this way doesn't require uncompression and recompression; the sound will be just as good (or bad) as the original.

However, be aware that if the source MP3s you have are low quality due to the low gain level, you can do nothing to improve this (except creating new MP3 files). So if the low gain level masks detoriation you'll hear at higher gain levels, then you'll have to live with that. Increasing the bitrate won't help.

4
  • Sure, I don't want to increase the bitrade to create quality that isn't there. I just planned to use the maximum possible bitrate to minimise the effect of loosing quality during decompression and recompression Commented Sep 30, 2019 at 9:01
  • 1
    What would be the command to normalize with mp3gain? Commented Sep 30, 2019 at 9:02
  • Checkout this answer: softwarerecs.stackexchange.com/a/39269/64451 Commented Jan 18, 2020 at 15:07
  • Using a player that is aware of ReplayGain tags in the files may also work. Commented Jan 11, 2021 at 14:58
0

LoudGain seems to be the perfect tool: https://github.com/Moonbase59/loudgain

It uses the well-known mp3gain commandline syntax but will never modify the actual audio data. Just what you ever wanted: The best of mp3gain, ReplayGain 2.0 and Linux combined.

It reduces gain to -1 dBTP (instead of 0 dBTP, according to EBU recommendation). Almost a security margin in the event that the further playout route "only" understands ReplayGain, but has no clipping prevention

Install LoudGain (using Homebrew):

wget https://raw.githubusercontent.com/Homebrew/install/master/install.sh # first check what you get before install ;) less install.sh # press q and then install homebrew with: /bin/bash -c install.sh brew install Moonbase59/tap/loudgain 

recommended use for mp3:

loudgain -I3 -S -L -a -k -s e *.mp3 

see https://github.com/Moonbase59/loudgain/blob/master/docs/loudgain.1.md#recommendations

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.