Linux audio tools: Is there a way to normalize the volume of .ogg files?

8

2

I want to normalize the volume of my whole music collection (.ogg files only).

Of course I can't (don't want to) do this in a GUI tool (too much clicking effort).

Is there a command line tool for Ubuntu Linux to do this?

linux_is_for_desktop

Posted 2009-08-15T13:12:58.400

Reputation: 678

Why would you want to do this? – endolith – 2010-07-24T15:24:28.793

Answers

9

Checkout the appropriately named Normalize:

Normalize is a tool for adjusting the volume of audio files to a standard level. This is useful for things like creating mixed CD's and mp3 collections, where different recording levels on different albums can cause the volume to vary greatly from song to song.

It works for all types of file formats, including wav, mp3 and .ogg.

Josh Hunt

Posted 2009-08-15T13:12:58.400

Reputation: 20 095

1Of course normalizing mp3s and oggs involves decoding and re-encoding them, which slightly degrades the quality... But anyway, normalize is a great tool – I especially like the batch mode which preservers the relative sound levels of an album. – Jonik – 2009-10-10T08:03:40.727

5

Edit 1:

I should mention that the tools I list below are not actually normalization tools, per se. They are tools for applying the replaygain algorithm to determine the music file's loudness and add a tag to the file indicating the relative loudness. The critical difference is that normalization actually involves re-encoding the audio data, whereas replaygain essentially just adds a sticky note telling your music player how loud the song is, so that the player can adjust for that. The advantage is that replaygain is lossless, because it doesn't modify the audio data. The disadvantage is that replaygain has no effect unless your music player knows about the tags. In particular, lots of portable mp3 players that support ogg fail to support replaygain tags, so if you're normalizing these audio files for a portable device, you're probably not going to want replaygain.

Anyway, here's a list of all the replaygain-able file types that I know of and the replaygain tool that works on them:

  • ogg vorbis: vorbisgain
  • mp3: mp3gain
  • aac (possibly also mp4 audio, m4a, and whatever other extensions Apple uses): aacgain
  • flac: metaflac --add-replay-gain
  • wavpack: wvgain

And that's all the ones I can think of for now.


Edit 2

I wrote my own tool for format-agnostic replay gain. It will work with any format recognized by Quod Libet. You can get it from GitHub here.

The downside is that you'll need to install a bunch of python modules to use it, since I've not given any thought to ease of setup.

Ryan C. Thompson

Posted 2009-08-15T13:12:58.400

Reputation: 10 085

Hey, I'm interested in trying your tool - how do I install the quodlibet.config module? I've installed the QuodLibet app but it didn't help. – diachedelic – 2016-01-22T05:00:45.307

You have to install Quod LIbet in such a way that your Python installation knows about it. Ways of doing this vary, but the way I did it was to download the source (from here) and install it using the standard build process for Python modules (i.e. ./setup.py build; ./setup.py install). This will install a copy of Quod Libet into whichever Python installation you're using.

– Ryan C. Thompson – 2016-01-22T08:20:19.790

I successfully built and installed Quodlibet 3.5.3 on OSX but quodlibet.config is still missing :( – diachedelic – 2016-01-23T08:41:35.570

I'm sorry, I haven't installed it on OSX before, so I can't really help you. – Ryan C. Thompson – 2016-01-23T18:22:51.210

wvgain tells me "not a valid WavPack file!" for my wavs... – Xerus – 2018-03-27T23:51:03.500

That's because a wav is not a wavpack file. – Ryan C. Thompson – 2018-03-28T00:03:15.437

1

You could investigate Replay Gain. I've not played with it much, but my understanding is that it scans a file (or directory/album) and adds meta-data to the tags, so that a Replay Gain aware player then adds the required amount of gain during playback to normalise the volume level.

Advantages: no decode/recode process, so faster, and no extra audio degradation due to re-encode

Disadvantages: Replay aware player(s) required.

Dave

Posted 2009-08-15T13:12:58.400

Reputation: 11

Do you mean mp3Gain? If yes, that's a GUI application and Windows only. – Bobby – 2011-03-16T13:09:23.413

1@Bobby: mp3Gain is only one implementation of ReplayGain. There are in fact many, for Linux too. – user1686 – 2011-03-17T05:42:12.963