You are not logged in.

#1 2012-12-30 15:25:25

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

[solved]Command line script to equalise volume levels of all mp3 files

Hello guys,

I have a bunch of mp3 files within a folder. Unfortunately they have unequal volume levels. Some of them are far too low, others too loud.

Is there a simple command line script to equalise all of them?

Regards

Robert

Last edited by orschiro (2012-12-30 17:44:59)

Offline

#2 2012-12-30 15:31:50

Xylankant
Member
From: Saarland, Germany
Registered: 2011-04-26
Posts: 21

Re: [solved]Command line script to equalise volume levels of all mp3 files

hi,

check out mp3gain
https://www.archlinux.org/packages/?sor … =&limit=50

sounds like that's just what you're looking for

Offline

#3 2012-12-30 16:34:14

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: [solved]Command line script to equalise volume levels of all mp3 files

I remember I found such a script a long time ago. I suppose it still works, here it is http://codepad.org/MLu1iscD. Please tell me if it works for you. By the way, it depends on mp3gain and python2-eyed3.

ps: As far as I can see, this script doesn't change the mp3 files itself, but stores the new volume in the id3 tag. This means, that you won't corrupt your files in any way, but the player needs to be able to get the volume information and adjust it. The script measures both the album and the track gain. Which one is used can be configured in the player.

Last edited by Army (2012-12-30 16:39:27)

Offline

#4 2012-12-30 17:44:29

orschiro
Member
Registered: 2009-06-04
Posts: 2,136
Website

Re: [solved]Command line script to equalise volume levels of all mp3 files

Very neat. mp3gain is exactly what I need.

I created an alias to pass the folder for which I want to normalise all files.

# .bashrc
# Expects the folder name and normalises all mp3 files in this folder, including subfolders
function mp3gainFunction {
	find $1 -iname '*.mp3' -execdir mp3gain -c -r -p -d 3 {} \+
}

alias mp3gain=mp3gainFunction

Offline

Board footer

Powered by FluxBB