24 September 2006

Edit nautilus "open with" right-click actions

Configuration for these actions are stored in /usr/share/applications/mimeinfo.cache, entries in this file link to files in /usr/share/applications/. E.g. /usr/share/applications/redhat-audio-player.desktop contains the command-line options used to start xmms.

Normalising volume of mp3 tracks - Part 2

This script handles albums properly so that the relative volume of seperate tracks in an album are maintained:

#/bin/bash

(

cd /srv/files/music

for album in `find . -mindepth 2 -type d -not \( -regex '\./.*/singles$' -or -regex '\./various/.*' \)`; do
echo "Processing album ${album}"
mp3gain -a -k -c ${album}/*.mp3
done

for singles in `find . -mindepth 2 -type d \( -regex '\./.*/singles$' -or -regex '\./various/.*' \)`; do
echo "Processing singles ${singles}"
mp3gain -r -k -c ${singles}/*.mp3
done

) | tee /var/log/normalise_music.log

Normalising volume of mp3 tracks

(find /srv/files/music -type f -iname '*.mp3' -print0 | xargs -0 -n 1 mp3gain -r -k -d 2) | tee mp3gain.log

MP3Gain does not decode and re-encode the mp3 to change its volume (this is good). You can change the volume as many times as you want, and the mp3 will sound just as good (or just as bad!) as it did before you started. Mp3Gain uses a special algorithm to calculate how loud the file actually sounds to a human's ears and writes a tag corresponding to the decibel value in the mp3. That tag will be read by any mp3 player that you play the file with. Let Mp3Gain analyze your whole mp3 library and all your songs will sound the same volume! But if for some reason, you want the volume back to its original value, Mp3Gain can remove the tag for you and the volume will be just as before.

You can first remove any existing gain values for music retrieved from unknown source using:

find . -type f -iname '*.mp3' -print0 | xargs -0 mp3gain -u