PDA

View Full Version : OT: Normalising FLACS



Ben Cook
2004-11-29, 16:38
A little off topic, but someone may have some experience of this...

I've finished ripping my CD collection to FLAC (One FLAC per track, no
CUE files) and now realise that a handful of my CDs are really quiet. I
could dig all my CDs out again and re-rip the quiet ones with
normalisation turned on, but was wondering if I can normalise my FLAC
albums as this would be loads quicker.

For some reason it seems to be the CDs I bought in the mid-eighties
which are quiet...

Cheers for any advice,

Ben.

Jeff Coffler
2004-11-29, 16:47
MessageHi Ben,
I've finished ripping my CD collection to FLAC (One FLAC per track, no CUE files) and now realise that a handful of my CDs are really quiet. I could dig all my CDs out again and re-rip the quiet ones with normalisation turned on, but was wondering if I can normalise my FLAC albums as this would be loads quicker.
Use a script like this, provided by Robin Bowes when I asked about this on October 20th. For further information, look at list archives for subject "Questions on FLAC (encoding w/ReplayGain, native flac support)" in October. Hope this helps ... -- Jeff


#!/usr/bin/perl -w
#
# Applies replaygain tags to all .flac files found within the
# specified directory tree. Album gain is also calculated for all
# files within each directory

use strict;

my $metaflac = "/usr/bin/metaflac";
my @flacargs = qw ( --preserve-modtime --add-replay-gain );

@ARGV = ('.') unless @ARGV;

process_dirs(@ARGV);

sub process_dirs {
my @dirlist = @_;
foreach my $dir (@dirlist) {
# get all directory entries
print "Processing directory: $dir\n";
opendir(DIR, $dir) or die "Couldn't open directory $dir\n";
my @direntries = readdir(DIR) or
die "Couldn't read directory entries for directory $dir\n";
closedir(DIR);

# get all target files within the present directory
my @target_files = map { $_->[1] } # extract pathnames
map { [ $_, "$dir/$_" ] } # form (name, path)
grep { /\.flac$/ } # just flac files
@direntries;

# get all subdirs of the present directory
my @subdirs = map { $_->[1] } # extract pathnames
grep { -d $_->[1] } # only directories
map { [ $_, "$dir/$_" ] } # form (name, path)
grep { !/^\.\.?$/ } # not . or ..
@direntries;

if (@target_files) {
# run metaflac on all target files in present directory
system ($metaflac, @flacargs, @target_files);
}
# process any subdirs of present directory
if (@subdirs) {
&process_dirs(@subdirs);
}
}
}

Robin Bowes
2004-11-29, 17:08
Jeff Coffler wrote:
> Hi Ben,
>
> I've finished ripping my CD collection to FLAC (One FLAC per track,
> no CUE files) and now realise that a handful of my CDs are really
> quiet. I could dig all my CDs out again and re-rip the quiet ones
> with normalisation turned on, but was wondering if I can normalise
> my FLAC albums as this would be loads quicker.
>
> Use a script like this, provided by Robin Bowes when I asked about this
> on October 20th. For further information, look at list archives for
> subject "Questions on FLAC (encoding w/ReplayGain, native flac support)"
> in October. Hope this helps ... -- Jeff

Wow, what a cool script?!! :) Are folk using this? Is it working without
any problems?

Just to clarify - this does *not* normalise the files. Instead it adds
ReplayGain tags to the flac files. To enable ReplayGain you need to
change the line that plays your flac files to:

[flac] --apply-replaygain-which-is-not-lossless=a -dcs
--force-raw-format --endian=little --sign=signed --skip=$START$
--until=$END$ $FILE$

R.
--
http://robinbowes.com
--
http://robinbowes.com

Jeff Coffler
2004-11-29, 17:43
From Robin Bowes on 11/29/2004 4:08 PM:

> Wow, what a cool script?!! :) Are folk using this? Is it working without
> any problems?
>
> Just to clarify - this does *not* normalise the files. Instead it adds
> ReplayGain tags to the flac files. To enable ReplayGain you need to
> change the line that plays your flac files to:
>
> [flac] --apply-replaygain-which-is-not-lossless=a -dcs
> --force-raw-format --endian=little --sign=signed --skip=$START$
> --until=$END$ $FILE$

I use it - it works fine. Ultimately, the script is pretty simple (relies
on metaflac to do the tagging), but it was nice that I didn't have to write
it myself. That's always a good thing! ;-) Thanks for the help last month,
Robin! ;-)

Actually, good point about normalization. But, of course, normalization is
bad - you'd lose one of the primary benefits of FLAC (a bit for bit copy of
the CD in a compressed form). But by using tags and ReplayGain, you can get
"normalization" behavior without losing the benefit of FLAC (i.e. you can
still make an exact copy of the original WAV file). This is great for me
.... I do NOT want to rip yet again, ever again, if I can help it!

-- Jeff

Jason Voegele
2004-11-29, 19:50
On Monday 29 November 2004 6:38 pm, Ben Cook wrote:
> A little off topic, but someone may have some experience of this...
>
> I've finished ripping my CD collection to FLAC (One FLAC per track,
> no CUE files) ... [snip]

Even further off topic, but do you know of any good resource that has
tips for CD ripping? I didn't know about CUE files which leads me to
believe there are other techniques that I might not be aware of.

Thanks.
--
Jason Voegele
Political T.V. commercials prove one thing: some candidates can tell
all their good points and qualifications in just 30 seconds.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)

iD8DBQBBq+ATyz7TB8Gh4rARAj41AJsFw36DP3WqYEEy/de4FCJQOccs9QCeLvBf
HbbpuAIn+eIfb511Pp9/YW0=
=PwqQ
-----END PGP SIGNATURE-----

Jason Holtzapple
2004-11-30, 07:22
Jason Voegele wrote:
> Even further off topic, but do you know of any good resource that has
> tips for CD ripping?

If you are using Exact Audio Copy (Windows) look here:

http://users.pandora.be/satcp/tutorials.htm