• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..14-Sep-2005-

fr/H14-Sep-2005-1,3251,106

Makefile.amH A D14-Sep-20051.5 KiB4615

Makefile.inH A D14-Sep-200517.4 KiB595525

README.sgmlH A D14-Sep-200518.8 KiB533446

normalize-mp3.1H A D09-Sep-20051.9 KiB8483

normalize.1H A D14-Sep-20057.9 KiB197188

normalize.1.sgmlH A D12-Sep-200512 KiB435347

README.sgml

1<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook V4.2//EN">
2
3<!--
4    Copyright 2005 Chris Vaill.
5
6    Permission is granted to copy, distribute, and/or modify this
7    document under the terms of the GNU General Public License as
8    published by the Free Software Foundation; either version 2 of the
9    License, or (at your option) any later version.
10-->
11
12<article lang="en">
13
14<articleinfo>
15<title>Normalize</title>
16<productname><application>normalize</application></productname>
17
18<!--
19<author>
20<firstname>Chris</firstname>
21<surname>Vaill</surname>
22<affiliation>
23<address>
24<email>chrisvaill at gmail</email>
25</address>
26</affiliation>
27</author>
28-->
29
30<!--
31<revhistory>
32<revision>
33<revnumber>v1.0</revnumber>
34<date>2001-09-16</date>
35<authorinitials>cmv</authorinitials>
36</revision>
37</revhistory>
38-->
39<!--
40<abstract>
41<para>
42Abstract here.
43	</para>
44</abstract>
45-->
46
47</articleinfo>
48
49<para>
50This is release 0.7.7 of Normalize, an audio file volume normalizer.
51	</para>
52<para>
53Copyright &copy; 1999--2005, Chris Vaill &lt;chrisvaill at gmail&gt;
54	</para>
55<para>
56Normalize is a tool for adjusting the volume of audio files to a
57standard level.  This is useful for things like creating mixed CD's
58and mp3 collections, where different recording levels on different
59albums can cause the volume to vary greatly from song to song.
60	</para>
61<para>
62Send bug reports, suggestions, comments to chrisvaill at gmail.
63	</para>
64<para>
65<command>normalize</command> is free software.  See the file
66<filename>COPYING</filename> for copying conditions.
67	</para>
68
69<!-- <bridgehead renderas="sect1">Installation synopsis</bridgehead> -->
70<section>
71<title>Installation synopsis</title>
72
73<para>
74
75<orderedlist>
76<listitem><para><userinput>./configure</userinput>
77<option><replaceable class="option">options</replaceable></option></para></listitem>
78<listitem><para><userinput>make</userinput></para></listitem>
79<listitem><para><userinput>make install</userinput></para></listitem>
80</orderedlist>
81
82See the file <filename>INSTALL</filename> for more extensive directions.
83See the man page, <filename>normalize.1</filename>, for usage.
84Run "<userinput>./configure --help</userinput>" for configure options.
85	</para>
86</section>
87
88<!-- <bridgehead renderas="sect1">Dependencies</bridgehead> -->
89<section>
90<title>Dependencies</title>
91
92<para>
93These dependencies are <emphasis>optional</emphasis>.  Normalize
94doesn't require any other packages to compile and run.
95	</para>
96
97<bridgehead renderas="other">
98<ulink url="http://www.underbit.com/products/mad/">
99MAD library (http://www.underbit.com/products/mad/)
100</ulink>
101</bridgehead>
102<para>
103Normalize will use the MAD MPEG Audio Decoder library if you have it
104(highly recommended).  This gives normalize the ability to read mp3
105files.  MAD support in normalize was developed using MAD version
1060.14.2b; earlier versions may not work.
107	</para>
108<para>
109You can run <userinput>configure</userinput> with the
110<userinput>--without-mad</userinput> option to turn off mp3 read
111support.
112	</para>
113
114<bridgehead renderas="other">
115<ulink url="http://www.68k.org/~michael/audiofile/">
116Audiofile library (http://www.68k.org/~michael/audiofile/)
117</ulink>
118</bridgehead>
119<para>
120Normalize can use the audiofile library if version 0.2.2 or later is
121available on your system.  This gives normalize the ability to read
122and write AIFF, AIFF-C, WAV, NeXT/Sun .snd/.au, Berkeley/IRCAM/CARL,
123and whatever else the audiofile library people decide to implement in
124the future.
125	</para>
126<para>
127Audiofile support is not turned on by default, because the built-in
128WAV support is faster (only because it's specifically tailored for PCM
129WAVs), and because I'm guessing most people only ever need to
130normalize standard PCM WAV and mp3 files.  If you only want to use
131normalize on standard PCM WAV and mp3 files, you don't need audiofile.
132If, however, you would like to be able to normalize all the different
133audio file formats that audiofile handles, run
134<userinput>configure</userinput> with the
135<userinput>--with-audiofile</userinput> option to turn on audiofile
136support.
137	</para>
138
139<bridgehead renderas="other">
140<ulink url="http://www.xmms.org/">
141XMMS (http://www.xmms.org/)
142</ulink>
143</bridgehead>
144<para>
145If you have xmms installed, the configure system will build the
146xmms-rva plugin, which honors the relative volume adjustment frames
147that normalize adds to ID3 tags.  The option
148<userinput>--disable-xmms</userinput> prevents the plugin from being
149built.
150	</para>
151</section>
152
153<!-- <bridgehead renderas="sect1">Questions and Answers</bridgehead> -->
154<section>
155<title>Questions and Answers</title>
156
157<QandAset>
158
159<qandaentry id="Q1">
160<question>
161<para>What platforms does normalize work on?</para>
162</question>
163<answer>
164<para>
165I've tested normalize on GNU/Linux and FreeBSD on x86, Solaris on
166Sparc, and Irix on MIPS.  I've heard that it works on GNU/Linux on
167Alpha and on BeOS R5.  As far as Windows is concerned, you can compile
168it using the <ulink url="http://www.cygwin.com/">Cygwin
169toolkit</ulink>.  <link linkend="Q8">Question 8</link>, below,
170contains a brief overview of this process.
171	</para>
172<para>
173I've tried to make the code as portable as possible, so I'd appreciate
174hearing whether normalize works on other platforms.
175	</para>
176</answer>
177</qandaentry>
178
179<qandaentry id="Q2">
180<question>
181<para>What is normalize useful for?</para>
182</question>
183<answer>
184<formalpara><title>Example 1</title>
185<para>
186Let's say you've got a bunch of wav files containing what are, in your
187estimation, Elvis's greatest hits, collected from various albums.  You
188want to encode them as mp3's and add them to an established
189collection, but since they're all from different albums, they're all
190recorded at different volumes from each other and from the rest of
191your mp3 collection.  If you've been using normalize on all your wav
192files before you encode them, your collection is normalized to the
193default volume level, and you want these new additions to be at the
194same level.  Just run normalize with no options on the files, and each
195will be adjusted to the proper volume level:
196<screen>
197            normalize "Hound Dog.wav" "Blue Suede Shoes.wav" \
198                      "Here Comes Santa Claus.wav" ...
199</screen>
200	</para>
201</formalpara>
202<formalpara><title>Example 2</title>
203<para>
204Suppose now you've just extracted all the wav files from the Gorilla
205Biscuits album "Start Today," which, you may know, is recorded at a
206particularly low volume.  We want to make the whole album louder, but
207individual tracks should stay at the same volume relative to each
208other.  For this we use <emphasis>batch mode</emphasis>.  Say the
209files are named <filename>01.wav</filename> to
210<filename>14.wav</filename>, and are in the current directory.  We
211invoke normalize in batch mode to preserve the relative volumes, but
212otherwise, everything's the default:
213<screen>
214            normalize -b *.wav
215</screen>
216You can then fire up your mp3 encoder, and the whole album will be
217uniformly louder.
218	</para>
219</formalpara>
220<formalpara><title>Example 3</title>
221<para>
222Now suppose we want to encode the Converge album "When Forever Comes
223Crashing."  This album has one song, "Ten Cents," that is really quiet
224while the rest of the songs have about the same (loud) volume.  We'll
225turn up the verbosity so we can see what's going on:
226<screen>
227        > normalize -bv *.wav
228        Computing levels...
229        Level for track01.cdda.wav: -9.3980dBFS (0.0000dBFS peak)
230        Level for track02.cdda.wav: -9.2464dBFS (-0.1538dBFS peak)
231        Level for track03.cdda.wav: -8.6308dBFS (-0.2520dBFS peak)
232        Level for track04.cdda.wav: -8.7390dBFS (0.0000dBFS peak)
233        Level for track05.cdda.wav: -8.1000dBFS (-0.0003dBFS peak)
234        Level for track06.cdda.wav: -8.2215dBFS (-0.1754dBFS peak)
235        Level for track07.cdda.wav: -8.9346dBFS (-0.1765dBFS peak)
236        Level for track08.cdda.wav: -13.6175dBFS (-0.4552dBFS peak)
237        Level for track09.cdda.wav: -9.0107dBFS (-0.1778dBFS peak)
238        Level for track10.cdda.wav: -8.1824dBFS (-0.4519dBFS peak)
239        Level for track11.cdda.wav: -8.5700dBFS (-0.1778dBFS peak)
240        Standard deviation is 1.47 dB
241        Throwing out level of -13.6175dBFS (different by 4.58dB)
242        Average level: -8.6929dBFS
243        Applying adjustment of -3.35dB...
244</screen>
245The volume of "Ten Cents," which is track 8, is 4.58 decibels off the
246average, which, given a standard deviation of 1.47 decibels, makes it
247a statistical aberration (which I've defined as anything off by more
248that twice the standard deviation, but you can set a constant decibel
249threshold with the <userinput>-t</userinput> option).  Therefore, it
250isn't counted in the average, and the adjustment applied to the album
251isn't thrown off because of one song.  Although the aberrant song's
252volume is not counted in the average, it is adjusted along with the
253rest of the files.
254	</para>
255</formalpara>
256<formalpara><title>Example 4</title>
257<para>
258Finally, say you want to make a mixed CD of 80's songs for your mom or
259something.  You won't allow any 80's songs to taint your hallowed mp3
260collection, so the absolute volumes of these tracks don't matter, as
261long as they're all about the same, so mom doesn't have to keep
262adjusting the volume.  For this, use the <emphasis>mix mode</emphasis>
263option,
264<screen>
265        normalize -m *.wav
266</screen>
267and each track will be adjusted to the average level of all the
268tracks.
269	</para>
270</formalpara>
271</answer>
272</qandaentry>
273
274<qandaentry id="Q3">
275<question>
276<para>How does normalize work?</para>
277</question>
278<answer>
279<para>
280A little background on how normalize computes the volume of a wav
281file, in case you want to know just how your files are being munged:
282	</para>
283<para>
284The volumes calculated are RMS amplitudes, which correspond (roughly)
285to perceived volume.  Taking the RMS amplitude of an entire file would
286not give us quite the measure we want, though, because a quiet song
287punctuated by short loud parts would average out to a quiet song, and
288the adjustment we would compute would make the loud parts excessively
289loud.
290	</para>
291<para>
292What we want is to consider the maximum volume of the file, and
293normalize according to that.  We break up the signal into 100 chunks
294per second, and get the signal power of each chunk, in order to get an
295estimation of "instantaneous power" over time.  This "instantaneous
296power" signal varies too much to get a good measure of the original
297signal's maximum <emphasis>sustained</emphasis> power, so we run a
298smoothing algorithm over the power signal (specifically, a mean filter
299with a window width of 100 elements).  The maximum point of the
300smoothed power signal turns out to be a good measure of the maximum
301sustained power of the file.  We can then take the square root of the
302power to get maximum sustained RMS amplitude.
303	</para>
304<para>
305As for the default target amplitude of 0.25 (-12dBFS), I've found that
306it's pretty close to the level of most of my albums already, but not
307so high as to cause a lot of limiting on quieter albums.  You may want
308to choose a different target amplitude, depending on your music
309collection (just make sure you normalize everything to the same
310amplitude if you want it to all be the same volume!).
311	</para>
312<para>
313Regarding clipping: since version 0.6, a limiter is employed to
314eliminate clipping.  The limiter is on by default; you don't have to
315do anything to use it.  The 0.5 series had a -c option to turn on
316limiting, but that limiter caused problems with inexact volume
317adjustment.  The new limiter doesn't have this problem, and the -c
318option is considered deprecated (it will be removed in version 1.0).
319	</para>
320<para>
321Please note that I'm not a recording engineer or an electrical
322engineer, so my signal processing theory may be off.  I'd be glad to
323hear from any signal processing wizards if I've made faulty
324assumptions regarding signal power, perceived volume, or any of that
325fun signal theory stuff.
326	</para>
327</answer>
328</qandaentry>
329
330<qandaentry id="Q4">
331<question>
332<para>
333Why don't you normalize using peak levels instead of RMS amplitude?
334	</para>
335</question>
336<answer>
337<para>
338Well, in early (unreleased) versions, this is how it worked. I found
339that this just didn't work well.  The volume that your ear hears
340corresponds more closely with average RMS amplitude level than with
341peak level.  Therefore, making the RMS amplitude of two files equal
342makes their perceived volume equal.  (Approximately equal, anyway:
343certain frequencies sound louder at the same amplitude because the ear
344is just more sensitive to those frequencies.  I may try to take this
345into account in a future version, but that opens up a whole new can of
346worms.)
347	</para>
348<para>
349"Normalizing" by peak level generally makes files with small dynamic
350range very loud and does nothing to files with large dynamic ranges.
351There's not really any normalization being done, it's more of a
352histogram expansion.  That said, since version 0.5, you can use the
353<userinput>--peak</userinput> option to do this in normalize if you're
354sure it's what you really want to do.
355	</para>
356</answer>
357</qandaentry>
358
359<qandaentry id="Q5">
360<question>
361<para>Can normalize operate directly on mp3 files?</para>
362</question>
363<answer>
364<para>
365Version 0.7 and up can operate directly on MPEG audio files.  An mp3
366file is decoded (using Robert Leslie's <ulink
367url="http://www.underbit.com/products/mad/">MAD library</ulink>) and
368analyzed on the fly, without the need for large temporary WAV files.
369The mp3 file is then "adjusted" by setting its <emphasis>relative
370volume adjustment</emphasis> information (technically, an "RVA2" frame
371is set in its ID3v2 tag).  The advantage of this method is that the
372audio data doesn't need to be touched, and you don't incur the cost of
373re-encoding.  The disadvantage is that your mp3 player needs to read
374and use relative volume adjustment ID3 frames.  The normalize
375distribution now includes a plugin for xmms that honors volume
376adjustment frames.  If you use an mp3 player other than xmms, you'll
377have to bug the author to support RVA2 frames in ID3 tags.
378	</para>
379<!--
380<para>
381MPEG layer III audio files store audio data as Huffman-coded frequency
382components.  Theoretically, frequency components can be analyzed and
383adjusted just as easily as time-domain samples (such as the PCM
384samples in a WAV file).  However, because the samples are
385Huffman-coded, it is likely that decoding the samples, adjusting them,
386and re-encoding them will cause them to take either more or fewer bits
387than before.  This is a problem, since MPEG audio files have a set
388bitrate.  Layer III files have a bit reservoir mechanism that could
389absorb some of the changes, but essentially there's no guarantee that
390adjusted audio data will still fit in the mp3 file.  The process of
391getting the data to fit in the given bitrate is basically the same as
392the encoding process.  That is, it's hard.
393	</para>
394-->
395<para>
396If you'd rather change the volume of the mp3 audio data itself, you
397still have to decode to WAV, normalize the WAV, and re-encode.  A
398script, <userinput>normalize-mp3</userinput>, is included in the
399normalize distribution to do this for you.
400	</para>
401</answer>
402</qandaentry>
403
404
405<qandaentry id="Q6">
406<question>
407<para>Can normalize operate on ogg vorbis files?</para>
408</question>
409<answer>
410<para>
411Version 0.8 will at least be able to read vorbis audio files.
412Adjusting is harder, though: the problem is that, unlike with ID3, as
413far as I know there's no standardized volume adjustment tag for ogg.
414I could just use, say, "VOLUME_ADJUST=X.XXdB" as an ogg comment, but
415there would be no reason for players to support it.
416	</para>
417<para>
418It may be possible to twiddle the vorbis data itself to alter the
419volume in a lossless way.  I'm looking into this, but it would be a
420big undertaking, not something that would be finished anytime soon.
421	</para>
422<para>
423The current situation is that you have to decode to WAV, normalize the
424WAV, and re-encode.  The <userinput>normalize-ogg</userinput> script
425is included in the normalize distribution to do this for you.
426	</para>
427</answer>
428</qandaentry>
429
430<qandaentry id="Q7">
431<question>
432<para>How do I normalize a whole tree of files recursively?</para>
433</question>
434<answer>
435<para>
436The "unix way" to do this is to use <command>find</command>:
437<screen>
438find . -type d -exec sh -c "normalize -b \"{}\"/*.mp3" \;
439</screen>
440will go directory by directory, running normalize -b on all mp3 files
441in each.  If you don't want batch mode, just:
442<screen>
443find . -name \*.mp3 -exec normalize {} \;
444</screen>
445will run normalize on each mp3 file separately.  If you want to run
446normalize in batch or mix mode on all files in the directory tree, use:
447<screen>
448find . -name \*.mp3 -print0 | xargs -0 normalize -b
449</screen>
450	</para>
451<para>
452A built-in recurse option has been a very popular request, so I'm
453adding support for it in version 0.8.
454	</para>
455</answer>
456</qandaentry>
457
458<qandaentry id="Q8">
459<question>
460<para>How do I use normalize in Windows?</para>
461</question>
462<answer>
463<para>
464"I click on INSTALL but nothing happens.  What's wrong?"  Okay, here's
465the deal: normalize is free software, written for free operating
466systems such as Linux and FreeBSD.  These happen to be unix-style
467operating systems, so normalize generally works on other non-free
468flavors of unix as well.  Unlike Windows software, unix software such
469as normalize is meant to run on many different operating systems on
470many different architectures, so usually it comes in source code form
471and you have to compile it for your particular setup.  If you are
472running some form of unix, normalize should compile right out of the
473box (let me know if it doesn't!).  For other operating systems, such
474as Amiga, BeOS, OS/2, or Windows, you may have to jump through some
475hoops to get it to compile.
476	</para>
477<para>
478A discussion of compiling unix software for Windows is way beyond the
479scope of this FAQ, but here's a quick rundown:
480  <orderedlist>
481    <listitem>
482    <para>
483    You first need the <ulink url="http://www.cygwin.com">Cygwin
484    toolkit</ulink>.  After installing, start up a cygwin bash shell.
485	</para>
486    </listitem>
487    <listitem>
488    <para>
489    Go to the directory where you unzipped the normalize archive -- it
490    would be named something like
491    <filename>normalize-x.y.z</filename>.
492	</para>
493    </listitem>
494    <listitem>
495    <para>
496    Type "<userinput>./configure</userinput>", then
497    "<userinput>make</userinput>", then
498    "<userinput>make&nbsp;install</userinput>"
499	</para>
500    </listitem>
501    <listitem>
502    <para>
503    If there were no errors, you can run normalize by typing
504    "<userinput>normalize</userinput>" at the prompt.  Normalize is a
505    command-line utility, so you have to pass it command line options.
506    Run "<userinput>normalize&nbsp;--help</userinput>" for a synopsis.
507	</para>
508    </listitem>
509
510  </orderedlist>
511	</para>
512</answer>
513</qandaentry>
514
515</QandAset>
516
517</section>
518
519<section>
520<title></title>
521<para>
522Copyright &copy; 1999--2005, Chris Vaill &lt;chrisvaill at gmail&gt;
523	</para>
524<para>
525Permission is granted to copy, distribute, and/or modify this document
526under the terms of the GNU General Public License as published by the
527Free Software Foundation; either version 2 of the License, or (at your
528option) any later version.
529	</para>
530</section>
531
532</article>
533