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
    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...

  • By
    LightFace:  Facebook Lightbox for MooTools

    One of the web components I've always loved has been Facebook's modal dialog.  This "lightbox" isn't like others:  no dark overlay, no obnoxious animating to size, and it doesn't try to do "too much."  With Facebook's dialog in mind, I've created LightFace:  a Facebook lightbox...

Incredible Demos

  • By
    Chris Coyier’s Favorite CodePen Demos II

    Hey everyone! Before we get started, I just want to say it's damn hard to pick this few favorites on CodePen. Not because, as a co-founder of CodePen, I feel like a dad picking which kid he likes best (RUDE). But because there is just so...

  • By
    Image Reflections with CSS

    Image reflection is a great way to subtly spice up an image.  The first method of creating these reflections was baking them right into the images themselves.  Within the past few years, we've introduced JavaScript strategies and CANVAS alternatives to achieve image reflections without...

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!