Normalize a Directory of mp3s

By  on  

Back in the early days of Napster, Kazaa, eMule, and other file sharing networks, I would download as many apps, movies, game, and movies as possible.  My illegal downloading was out of control; I would get DMCA notices from my ISP for apps and games I had no intention of using -- I would simply download them because I could.  And when someone finally cracked the holy grail, Half-Life 2, I was in heaven!

Getting apps and games to work required keygens and cracks, which was a fun challenge, but one annoyance was that pirated mp3 volume always seemed to be different.  One mp3 would be quiet, the next would super loud, and so on, so each song would require me to man the volume controls like a DJ.  Today I download mp3s from YouTube and still the volume is different from source to source, thus I'm still needing to adjust volume while I drive or code.  Ugh!

Since the same volume problem exists today from my YouTube downloads, I searched for command line utility to equalize mp3 volume and the winner was mp3gain.  With mp3gain you can equalize a directory of mp3s from command line with ease!

# From the mp3s' containing directory
mp3gain -r *.mp3

# RESULT: 
# 2Pac - Dear Mama.mp3
# Applying mp3 gain change of -4 to 2Pac - Dear Mama.mp3...
# Orestes - A Perfect Circle.mp3
# Applying mp3 gain change of -4 to Orestes - A Perfect Circle.mp3...
# Adele - Rolling in the Deep.mp3
# Applying mp3 gain change of -4 to Adele - Rolling in the Deep.mp3...

mp3gain will analyze all mp3s for volume, create a baseline, and equalize the volume in all mp3 files.

If you're hosting a party or simply don't want to be a slave to the volume knob, check out mp3gain.  Of course we shouldn't whine about free music but hey -- we're tech savvy and know how to get what we want.  The audio volume level issue isn't one that will go away any time soon so keep mp3gain in your toolbox!

Recent Features

  • By
    Write Better JavaScript with Promises

    You've probably heard the talk around the water cooler about how promises are the future. All of the cool kids are using them, but you don't see what makes them so special. Can't you just use a callback? What's the big deal? In this article, we'll...

  • By
    JavaScript Promise API

    While synchronous code is easier to follow and debug, async is generally better for performance and flexibility. Why "hold up the show" when you can trigger numerous requests at once and then handle them when each is ready?  Promises are becoming a big part of the JavaScript world...

Incredible Demos

  • By
    MooTools History Plugin

    One of the reasons I love AJAX technology so much is because it allows us to avoid unnecessary page loads.  Why download the header, footer, and other static data multiple times if that specific data never changes?  It's a waste of time, processing, and bandwidth.  Unfortunately...

  • By
    MooTools Accordion: Mouseover Style

    Everyone loves the MooTools Accordion plugin but I get a lot of requests from readers asking me how to make each accordion item open when the user hovers over the item instead of making the user click. You have two options: hack the original plugin...

Discussion

  1. Unfortunately normalization (optimizing the peak signal level) has no consistent relationship to the overall loudness of a track. Peak optimization and perceived loudness are two different things.
    The perception of loudness is related to sound pressure level, frequency and duration of a sound.
    You should look into automated methods to equalize sound pressure levels.

  2. I remember downloading a client (forget the name) for Linux that allowed me to purchase songs off iTunes in Linux. It took a lot of work to give Apple my money, but I wanted to pay for the music.

    A lot of the music files (still) don’t have metadata (a setback from using that client)

Wrap your code in <pre class="{language}"></pre> tags, link to a GitHub gist, JSFiddle fiddle, or CodePen pen to embed!