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
    Interview with a Pornhub Web Developer

    Regardless of your stance on pornography, it would be impossible to deny the massive impact the adult website industry has had on pushing the web forward. From pushing the browser's video limits to pushing ads through WebSocket so ad blockers don't detect them, you have...

  • By
    Creating Scrolling Parallax Effects with CSS

    Introduction For quite a long time now websites with the so called "parallax" effect have been really popular. In case you have not heard of this effect, it basically includes different layers of images that are moving in different directions or with different speed. This leads to a...

Incredible Demos

  • By
    Create Twitter-Style Dropdowns Using jQuery

    Twitter does some great stuff with JavaScript. What I really appreciate about what they do is that there aren't any epic JS functionalities -- they're all simple touches. One of those simple touches is the "Login" dropdown on their homepage. I've taken...

  • By
    MooTools CountDown Plugin

    There are numerous websites around the internet, RapidShare for example, that make you wait an allotted amount of time before presenting you with your reward. Using MooTools, I've created a CountDown plugin that allows you to easily implement a similar system. The MooTools JavaScript The CountDown class...

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!