Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Click here to return to the 'Lossless adjusting of loudness for MP3 and AAC files' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Lossless adjusting of loudness for MP3 and AAC files
Authored by: okto on Jun 02, '05 02:04:04AM
I wrote a shell script to go thru the ~/Music/iTunes/iTunes Music folder and AACGain everything.
I didn't like that Polonus' AACGain iTunes scripts locked up iTunes while they ran (not by fault of the author, that's just how iTunes works--thanks for the work on that, Polonus!), so I thought to myself, "Self, we have a recursing script to write M3U playlists. We could probably hack that into a script to AACGain the contents of the iTunes library, and still be able to play things in iTunes."
Self was right (no, I don't have MPD :P), and here you go.
It's not that complex, just some nested foreaches, but it works well. Feel free to distrubute/modify/include, just drop me a line if you find it useful, modify it, or incorporate it in something else.

#! /bin/tcsh 
#! //okto 2005 
#! Recursively runs aacgain (, 
#! on your iTunes library.

# it breaks otherwise. not quite sure why.
set nonomatch
cd ~/Music/iTunes/iTunes\ Music/

foreach ARTIST ( * )
echo next artist
	if ( ! -d "$ARTIST" ) continue
	echo "artist: $ARTIST"
       cd "$ARTIST"
	foreach ALBUM ( * )
		if ( ! -d "$ALBUM" ) continue
		echo "		album: $ALBUM"
              cd "$ALBUM"
#if you do ``*.mp3 *.m4a'' it fusses about it
		aacgain -r -p -t -k *.m*
		cd ..		
	cd ..

[ Reply to This | # ]