Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

When listening to music in Banshee or any other player, I always have to up the volume for certain songs and turn it back down for others because they don't have the same replay gain.

  • Is there an add-on which could normalise my songs in Banshee?
  • Or is there a program which could do this to whole of my music library?

I'm currently running Ubuntu 12.04 in case that has any effect on the answers.

Thanks in advance.

share|improve this question
    
In Edit > Preferences Banshee has an option to enable ReplayGain correction. I think this is even turned on by default. Is it not working for you? –  michaelms Jul 24 '12 at 7:51
    
It works relatively well but for songs which have too much of a difference it doesn't do well enough for my liking. –  Oyibo Jul 24 '12 at 8:00
1  
Instead of using a bunch of different utilities for differing formats, you can just use sox. There's an example in the man page I think... –  hbdgaf Aug 23 '12 at 18:30
add comment

3 Answers

up vote 13 down vote accepted
+50

I use a command line utility called mp3gain, which is available in the repositories.

To use it, go into the directory where you store your music files, and then run this command:

find -name '*mp3' -exec mp3gain -r -k {} \;

It will go through every subdirectory, finding any file ending with .mp3, and normalize the gain so that they will also play back at a consistent volume.

Also note that mp3gain won't act on files that are already within the range you want, so the second time you run it and thereafter, it won't take as long as the first time. So you can just run this command as is every time you add new files, whether its just one new file, or a whole bunch.

If you happen to have .ogg files, there is a similar program called vorbisgain:

find -name '*ogg' -exec vorbisgain -r {} \;

There are options for how you normalize the gain for any one song in comparison to the rest of the music you have, but it's been so long since I've looked at them I can't really say much about it. I just know that I play my entire library as one huge randomized collection, and the above comand and its settings has worked for me for years.

If you happen to have .flac files, you can use metaflac:

find -name '*flac' -exec metaflac --add-replay-gain {} \;

Hope that helps.

share|improve this answer
    
Please note that compared to replaygain, which simply adds a meta-tag, mp3gain will permanently alter the data in your MP3s to normalize them; it's effect cannot be removed or reversed without technically affecting the quality of the MP3, although any difference may be imperceptible to most human ears. –  izx Jul 21 '12 at 10:24
5  
@izx This is wrong. mp3gain is “lossless” as it uses a gain attribute in each frame of mp3 data. From mp3gain(1): Also, the changes mp3gain makes are completely lossless. There is no quality lost in the change because the program adjusts the mp3 file directly, without decoding and reencoding.. So while it may be difficult to figure out the initial values, they're just modified by a constant offset, which is perfectly revertible. –  Jonas Wielicki Jul 21 '12 at 12:49
2  
@Oyibo I filed an edit request for the answer which contains what you have to do for flac files. Replace *ogg with *flac and vorbisgain -r with metaflac --add-replay-gain. mp3gain will calculate the offset in a way similar to what vorbisgain & co. do, so it should not be neccessary to do that by hand. –  Jonas Wielicki Jul 21 '12 at 13:32
1  
@Oyibo The Option in Banshee afaik only activates support for reading RG-tags from files, it does not do the correction on the fly. So it won't work for files not having any RG tags (which may be why it doesn't work on some files for you). –  Jonas Wielicki Jul 21 '12 at 13:33
1  
@Oyibo You would not want that, because the offset is scaled so that it plays along with other replaygain files. You would use your volume control for that. –  Jonas Wielicki Jul 21 '12 at 13:40
show 5 more comments

I don't think there is an add-on for Banshee itself, but you can normalise volume across your collection. On AVP, I've found two ways to get it done:

  • sox: install via sudo apt-get install sox or the Ubuntu Software Center. In a terminal, navigate to the directory where your music files reside using the cd command, then type sox <input-file.mp3> <output-file.mp3> gain −n −3. This will normalise the mp3 file's level to -3 dB relative to full scale deflection.

  • normalize-mp3: this application is the way to go when you're handling multiple files. Install via sudo apt-get install normalize-audio or the Ubuntu Software Center. In a terminal, navigate to the directory where your music files reside using the cd command, then type normalize-audio -b *.mp3 for artist albums, or normalize-audio -m *.mp3 for mix albums.

share|improve this answer
add comment

You can use audacity to normalize the volume of you whole music library.

Audacity is a free, easy-to-use and multilingual audio editor and recorder for Windows, Mac OS X, GNU/Linux and other operating systems. You can use Audacity to:

  • Record live audio.
  • Convert tapes and records into digital recordings or CDs.
  • Edit Ogg Vorbis, MP3, WAV or AIFF sound files.
  • Cut, copy, splice or mix sounds together.
  • Change the speed or pitch of a recording.
  • And more! See the complete list of features.

One of these features, is Adjust volume with Compressor, Amplify, Normalize and Fade In/Out effects.1

Note: Using audacity will affect the quality of your music. But, if your music library is all high quality mp3, I mean 256 and 320 kbit/s, and the sampling frequency is 44.1 and 48 kHz, you probably will not notice a quality loss (drop). Now audacity claims that they have significantly improved Normalize, but I think that this should be kept in mind before you try to normalize the sound.

1Source:Audacity

share|improve this answer
2  
The problem with Audacity is that it will cause a quality loss (and make the volume change irreversible), because it has to decode and re-encode the MP3 file to be able to edit it... –  izx Aug 24 '12 at 19:17
    
I know, I used it on my media, of 320 kbit/s, and you can hardly notice any quality drop. But you're right it does affect the quality. –  Mitch Aug 24 '12 at 19:20
1  
agreed. Could you add a small note at the end in this regard? Thanks. –  izx Aug 24 '12 at 19:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.