I'm just getting towards the end of the horrible task of ripping all my music from CD to flac. I did all of this without any normalisation, but I'm beginning to wonder if this was a mistake. What exactly does the normalisation process do? Can it be done "post-rip" by a Linux tool (my server runs Debian Testing)? Do you lose quality by doing this? It's a bit of a pain to have tracks play at significantly different volume levels when create playlists from different albums, but I'm prepared to put up with this if the alternative is loss of quality.
Results 1 to 10 of 36
Thread: Normalising FLAC files
-
2005-04-09, 05:19 #1
Normalising FLAC files
Some people think the title of this song is irrelevant,
but it's not irrelevant - it's a hippopotamus.
-
2005-04-09, 05:31 #2Christian PerneggerGuest
Normalising FLAC files
The preferred method for doing this is ReplayGain, which stores gain
correction values for the track on its own and for the track as part
of its album. Unlike regular normalization this doesn't touch your
audio data at all - it's only applied at playback time.
A quick apt-cache search tells me that crip should be able to add the
relevant info under linux.
AFAIK the sb doesn't support RG yet, though. An enhancement bug has
been filed under http://bugs.slimdevices.com/show_bug.cgi?id=1311
C.
-
2005-04-09, 11:55 #3
Thanks for the information. I've had a quick look at crip, and it looks like it relies on doing the ripping there and then. Unfortunately, I've just about finished doing my ripping so need something that can read through already encoded flac files, calculate replay gain information for them and then write it into the files. If anyone knows a tool that can do this, I'd be very grateful to hear about it!
Some people think the title of this song is irrelevant,
but it's not irrelevant - it's a hippopotamus.
-
2005-04-09, 21:02 #4
flac replaygain can be applied serverside, as long as you don't mind sending wav to the squeezebox.
Here's my slimserver-convert.conf file:
flc wav * *
[flac] -dcs --force-raw-format --endian=little --sign=signed --apply-replaygain-which-is-not-lossless=a --skip=$START$ --until=$END$ $FILE$
flc mp3 * *
[flac] -dcs --apply-replaygain-which-is-not-lossless=a --skip=$START$ --until=$END$ $FILE$ | [lame] --resample 44100 --silent -q 9 -b $BITRATE$ - -
metaflac --add-replay-gain *.flac will add the replaygain tags to an album's worth of flac files. If you are fortunate to have 1 album per directory it is pretty straightforward to write a script to recursively add replaygain correctly to your albums.
-
2005-04-10, 03:19 #5Aha! I hadn't spotted that metaflac would do that for me. Thanks for pointing that out! I assume that replay gain for FLAC will be added to the SB2 at some point in the future. Does anyone have any further information on that?
Originally Posted by jth
Some people think the title of this song is irrelevant,
but it's not irrelevant - it's a hippopotamus.
-
2005-04-10, 07:35 #6
My music is all stored in a directory for each album, so I guess I can simply do the following:
---
#!/bin/sh
basedir=${1:-.}
IFS="
"
for dir in `find $basedir -type d`; do
metaflac --add-replay-gain "$dir/*.flac"
done
---
This would work, but would output errors for loads of directories that only contain other directories. Can anyone suggest how to only call metaflac for directories containing flac files?Some people think the title of this song is irrelevant,
but it's not irrelevant - it's a hippopotamus.
-
2005-04-10, 13:40 #7
A lazy person might just redirect stderr to /dev/null, or you might try something like [ -f "$dir/*.flac" ] && metaflac --add-replay-gain "$dir/*.flac"
-
2005-04-10, 14:07 #8
I don't think this would work. If you put quotes around the *, it doesn't expand. If you remove them, it expands and test complains that there are too many arguments. I haven't yet tried this though, so I could be wrong.
Some people think the title of this song is irrelevant,
but it's not irrelevant - it's a hippopotamus.
-
2005-04-10, 14:32 #9
Yes, you are right, I had forgotten that file test operators only work on single files. Perhaps something like this:
ls $dir/*.flac >/dev/null 2>&1 && metaflac --add-replay-gain $dir/*.flac
As with any sort of this kind of script, I'd recommend duplicating a portion of your directory tree and testing against that to ensure correct behavior before running against your whole collection.
-
2005-04-11, 04:35 #10
Ooh, nice hack! The joys of UNIX shell scripting. :-) That said, I had the misfortune to have to right some Win95 batch files the other day. You have to use GOTOs for goodness sake!
Some people think the title of this song is irrelevant,
but it's not irrelevant - it's a hippopotamus.

Reply With Quote
