blob: c3649dc87440640bad5f559ea97ffd66d027c09b [file] [log] [blame]
Josh Coalson5e5fc012002-07-16 16:09:53 +00001<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
Josh Coalson95643902004-01-17 04:14:43 +00002<!-- Copyright (c) 2000,2001,2002,2003,2004 Josh Coalson -->
Josh Coalson5e5fc012002-07-16 16:09:53 +00003<!-- Permission is granted to copy, distribute and/or modify this document -->
4<!-- under the terms of the GNU Free Documentation License, Version 1.1 -->
5<!-- or any later version published by the Free Software Foundation; -->
6<!-- with no invariant sections. -->
7<!-- A copy of the license can be found at http://www.gnu.org/copyleft/fdl.html -->
8<HTML>
9<HEAD>
10 <TITLE>FLAC - documentation</TITLE>
11</HEAD>
12
13<BODY MARGINWIDTH="0" MARGINHEIGHT="0" LEFTMARGIN="0" RIGHTMARGIN="0" TOPMARGIN="0" BGCOLOR="#99CC99" TEXT="#000000" LINK="#336699" VLINK="#336699" ALINK="#336699">
14
15<TABLE BORDER=0 WIDTH="100%" CELLPADDING=1 CELLSPACING=0>
16 <TR>
Josh Coalson45cb2db2003-11-07 23:40:59 +000017 <TD ALIGN="CENTER" BGCOLOR="#000000"><A HREF="http://flac.sourceforge.net/"><IMG SRC="images/logo130.gif" ALIGN=CENTER ALT="FLAC Logo" BORDER=0 HSPACE=0></a></TD>
Josh Coalson5e5fc012002-07-16 16:09:53 +000018 </TR>
19</TABLE>
20
21<TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#99CC99"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="25" ALT=""></TD></TR></TABLE>
22
23<TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="2" ALT=""></TD></TR></TABLE>
24
25<TABLE WIDTH="100%" CELLPADDING=0 CELLSPACING=0 BORDER=0>
26 <TR>
27 <TD ALIGN="CENTER" BGCOLOR="#D3D4C5">
28 <TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0>
29 <TR>
30 <TD HEIGHT=22 BGCOLOR="#D3D4C5" ALIGN=CENTER NOWRAP>&nbsp;&nbsp;<A CLASS="topnav" HREF="index.html">home</A>&nbsp;&nbsp;</TD><TD BGCOLOR="#D3D4C5" ALIGN=CENTER>|</TD>
Josh Coalsonf1c72d52003-08-28 23:36:14 +000031 <TD BGCOLOR="#D3D4C5" ALIGN=CENTER NOWRAP>&nbsp;&nbsp;<A CLASS="topnav" HREF="faq.html">faq</A>&nbsp;&nbsp;</TD><TD BGCOLOR="#D3D4C5" ALIGN=CENTER>|</TD>
Josh Coalson5e5fc012002-07-16 16:09:53 +000032 <TD BGCOLOR="#D3D4C5" ALIGN=CENTER NOWRAP>&nbsp;&nbsp;<A CLASS="topnav" HREF="news.html">news</A>&nbsp;&nbsp;</TD><TD BGCOLOR="#D3D4C5" ALIGN=CENTER>|</TD>
33 <TD BGCOLOR="#D3D4C5" ALIGN=CENTER NOWRAP>&nbsp;&nbsp;<A CLASS="topnav" HREF="download.html">download</A>&nbsp;&nbsp;</TD><TD BGCOLOR="#D3D4C5" ALIGN=CENTER>|</TD>
34 <TD BGCOLOR="#D3D4C5" ALIGN=CENTER NOWRAP>&nbsp;&nbsp;<A CLASS="topnav" HREF="features.html">features</A>&nbsp;&nbsp;</TD><TD BGCOLOR="#D3D4C5" ALIGN=CENTER>|</TD>
35 <TD BGCOLOR="#D3D4C5" ALIGN=CENTER NOWRAP>&nbsp;&nbsp;<A CLASS="topnav" HREF="goals.html">goals</A>&nbsp;&nbsp;</TD><TD BGCOLOR="#D3D4C5" ALIGN=CENTER>|</TD>
36 <TD BGCOLOR="#D3D4C5" ALIGN=CENTER NOWRAP>&nbsp;&nbsp;<A CLASS="topnav" HREF="format.html">format</A>&nbsp;&nbsp;</TD><TD BGCOLOR="#D3D4C5" ALIGN=CENTER>|</TD>
37 <TD BGCOLOR="#D3D4C5" ALIGN=CENTER NOWRAP>&nbsp;&nbsp;<A CLASS="topnav" HREF="id.html">id</A>&nbsp;&nbsp;</TD><TD BGCOLOR="#D3D4C5" ALIGN=CENTER>|</TD>
38 <TD BGCOLOR="#D3D4C5" ALIGN=CENTER NOWRAP>&nbsp;&nbsp;<A CLASS="topnav" HREF="comparison.html">comparison</A>&nbsp;&nbsp;</TD><TD BGCOLOR="#D3D4C5" ALIGN=CENTER>|</TD>
39 <TD BGCOLOR="#D3D4C5" ALIGN=CENTER NOWRAP>&nbsp;&nbsp;documentation&nbsp;&nbsp;</TD><TD BGCOLOR="#D3D4C5" ALIGN=CENTER>|</TD>
Josh Coalsonc844f5f2004-07-29 23:59:21 +000040 <TD BGCOLOR="#D3D4C5" ALIGN=CENTER NOWRAP>&nbsp;&nbsp;<A CLASS="topnav" HREF="changelog.html">changelog</A>&nbsp;&nbsp;</TD><TD BGCOLOR="#D3D4C5" ALIGN=CENTER>|</TD>
41 <TD BGCOLOR="#D3D4C5" ALIGN=CENTER NOWRAP>&nbsp;&nbsp;<A CLASS="topnav" HREF="links.html">links</A>&nbsp;&nbsp;</TD><TD BGCOLOR="#D3D4C5" ALIGN=CENTER>|</TD>
Josh Coalson5e5fc012002-07-16 16:09:53 +000042 <TD BGCOLOR="#D3D4C5" ALIGN=CENTER NOWRAP>&nbsp;&nbsp;<A CLASS="topnav" HREF="developers.html">developers</A>&nbsp;&nbsp;</TD>
43 </TR>
44 </TABLE>
45 </TD>
46 </TR>
47</TABLE>
48
49<TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="2" ALT=""></TD></TR></TABLE>
50
51<TABLE WIDTH="100%" CELLPADDING=0 CELLSPACING=0 BORDER=0>
52 <TR>
53 <TD ALIGN="CENTER" BGCOLOR="#EEEED4">
54 <TABLE CELLPADDING=0 CELLSPACING=0 BORDER=0>
55 <TR>
56 <TD HEIGHT=22 BGCOLOR="#EEEED4" ALIGN=CENTER NOWRAP>&nbsp;&nbsp;english&nbsp;&nbsp;</TD><TD BGCOLOR="#EEEED4" ALIGN=CENTER>|</TD>
57 <TD BGCOLOR="#EEEED4" ALIGN=CENTER NOWRAP>&nbsp;&nbsp;<A CLASS="topnav" HREF="ru/documentation.html">russian</A>&nbsp;&nbsp;</TD>
58 </TR>
59 </TABLE>
60 </TD>
61 </TR>
62</TABLE>
63
64<TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="2" ALT=""></TD></TR></TABLE>
65
66<CENTER>
67
68<TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#99CC99"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="15" ALT=""></TD></TR></TABLE>
69
70
71<TABLE WIDTH="100%" CELLPADDING="5" CELLSPACING="5" BORDER="0">
72<TR><TD>
73 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
74 <TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#D3D4C5">
75 <TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
76 <B><FONT SIZE="+2">documentation</FONT></B>
77 </FONT></TD></TR>
78 </TABLE>
79 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
80 <TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#EEEED4">
81 <TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
82 <P>
83 This page is broken up into the following sections:
84 <UL>
85 <LI><A HREF="#format">format</A> - the user-level view of the FLAC format (for a more detailed explanation see the <A HREF="format.html">format page</A>).</LI>
86 <LI><A HREF="#flac">flac</A> - the usage of the command-line file encoder/decoder <B><TT>flac</TT></B>.</LI>
87 <LI><A HREF="#metaflac">metaflac</A> - the usage of the command-line FLAC metadata editor <B><TT>metaflac</TT></B>.</LI>
88 <LI><A HREF="#plugins">plugins</A> - documentation for the various input plugins.</LI>
Josh Coalson746dd682002-07-27 05:00:53 +000089 <LI><A HREF="api/index.html">libFLAC and libFLAC++ APIs</A> - for developers who want to add FLAC support to their programs.</LI>
Josh Coalson5e5fc012002-07-16 16:09:53 +000090 <LI><A HREF="#bugs">bugs</A> - known bugs.</LI>
91 <LI><A HREF="#monkey">How to add FLAC support to the Monkey's Audio GUI</A></LI>
92 </UL>
93 </P>
94 <P>
95 Keep in mind that the online version of this document will always apply to the latest release. For older releases, check the documentation included with the release package.
96 </P>
97 </FONT>
98 </TD></TR>
99 </TABLE>
100 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
101</TD></TR>
102</TABLE>
103
104
105<TABLE WIDTH="100%" CELLPADDING="5" CELLSPACING="5" BORDER="0">
106<TR><TD>
107 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
108 <TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#D3D4C5">
109 <TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
110 <A NAME="format"><B><FONT SIZE="+2">format</FONT></B>
111 </FONT></TD></TR>
112 </TABLE>
113 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
114 <TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#EEEED4">
115 <TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
116 <P>
117 <B><TT>flac</TT></B> has been tuned so that the default options yield a good speed vs. compression tradeoff for many kinds of input. However, if you are looking to maximize the compression rate or speed, or want to use the full power of FLAC's metadata system, this section is for you. If not, just skip to the <A HREF="#flac">next section</A>.
118 </P>
119 <P>
120 The basic structure of a FLAC stream is:
121 <UL>
122 <LI>The four byte string "fLaC"</LI>
123 <LI>The <A HREF="format.html#def_STREAMINFO">STREAMINFO</A> metadata block</LI>
124 <LI>Zero or more other metadata blocks</LI>
125 <LI>One or more audio frames</LI>
126 </UL>
127 </P>
128 <P>
129 The first four bytes are to identify the FLAC stream. The metadata that follows contains all the information about the stream except for the audio data itself. After the metadata comes the encoded audio data.
130 </P>
131 <P>
132 <B>METADATA</B>
133 </P>
134 <P>
Josh Coalson99060562002-12-21 03:28:06 +0000135 FLAC defines several types of metadata blocks (see the <A HREF="format.html">format</A> page for the complete list). Metadata blocks can be any length and new ones can be defined. A decoder is allowed to skip any metadata types it does not understand. Only one is mandatory: the STREAMINFO block. This block has information like the sample rate, number of channels, etc., and data that can help the decoder manage its buffers, like the minimum and maximum data rate and minimum and maximum block size. Also included in the STREAMINFO block is the MD5 signature of the <I>unencoded</I> audio data. This is useful for checking an entire stream for transmission errors.
Josh Coalson5e5fc012002-07-16 16:09:53 +0000136 </P>
137 <P>
Josh Coalsonadcc4a12002-12-21 04:50:22 +0000138 Other blocks allow for padding, seek tables, tags, cuesheets, and application-specific data. You can see <B><TT>flac</TT></B> options below for adding PADDING blocks or specifying seek points. FLAC does not require seek points for seeking but they can speed up seeks, or be used for cueing in editing applications.
Josh Coalson5e5fc012002-07-16 16:09:53 +0000139 <P>
140 </P>
141 Also, if you have a need of a custom metadata block, you can define your own and request an ID <A HREF="id.html">here</A>. Then you can reserve a PADDING block of the correct size when encoding, and overwrite the padding block with your APPLICATION block after encoding. The resulting stream will be FLAC compatible; decoders that are aware of your metadata can use it and the rest will safely ignore it.
142 </P>
143 <P>
144 <B>AUDIO DATA</B>
145 </P>
146 <P>
147 After the metadata comes the encoded audio data. Audio data and metadata are not interleaved. Like most audio codecs, FLAC splits the unencoded audio data into blocks, and encodes each block separately. The encoded block is packed into a frame and appended to the stream. The reference encoder uses a single block size for the whole stream but the FLAC format does not require it.
148 </P>
149 <P>
150 <B>BLOCKING</B>
151 </P>
152 <P>
153 The block size is an important parameter to encoding. If it is too small, the frame overhead will lower the compression. If it is too large, the modeling stage of the compressor will not be able to generate an efficient model. Understanding FLAC's modeling will help you to improve compression for some kinds of input by varying the block size. In the most general case, using linear prediction on 44.1kHz audio, the optimal block size will be between 2-6 ksamples. <B><TT>flac</TT></B> defaults to a block size of 4608 in this case. Using the fast fixed predictors, a smaller block size is usually preferable because of the smaller frame header.
154 </P>
155 <P>
156 <B>INTER-CHANNEL DECORRELATION</B>
157 </P>
158 <P>
159 In the case of stereo input, once the data is blocked it is optionally passed through an inter-channel decorrelation stage. The left and right channels are converted to center and side channels through the following transformation: mid = (left + right) / 2, side = left - right. This is a lossless process, unlike joint stereo. For normal CD audio this can result in significant extra compression. <B><TT>flac</TT></B> has two options for this: <TT>-m</TT> always compresses both the left-right and mid-side versions of the block and takes the smallest frame, and <TT>-M</TT>, which adaptively switches between left-right and mid-side.
160 </P>
161 <P>
162 <B>MODELING</B>
163 </P>
164 <P>
165 In the next stage, the encoder tries to approximate the signal with a function in such a way that when the approximation is subracted, the result (called the <I>residual</I>, <I>residue</I>, or <I>error</I>) requires fewer bits-per-sample to encode. The function's parameters also have to be transmitted so they should not be so complex as to eat up the savings. FLAC has two methods of forming approximations: 1) fitting a simple polynomial to the signal; and 2) general linear predictive coding (LPC). I will not go into the details here, only some generalities that involve the encoding options.
166 </P>
167 <P>
168 First, fixed polynomial prediction (specified with <TT>-l 0</TT>) is much faster, but less accurate than LPC. The higher the maximum LPC order, the slower, but more accurate, the model will be. However, there are diminishing returns with increasing orders. Also, at some point (usually around order 9) the part of the encoder that guesses what is the best order to use will start to get it wrong and the compression will actually decrease slightly; at that point you will have to you will have to use the exhaustive search option <TT>-e</TT> to overcome this, which is significantly slower.
169 </P>
170 <P>
171 Second, the parameters for the fixed predictors can be transmitted in 3 bits whereas the parameters for the LPC model depend on the bits-per-sample and LPC order. This means the frame header length varies depending on the method and order you choose and can affect the optimal block size.
172 </P>
173 <P>
174 <B>RESIDUAL CODING</B>
175 </P>
176 <P>
177 Once the model is generated, the encoder subracts the approximation from the original signal to get the residual (error) signal. The error signal is then losslessly coded. To do this, FLAC takes advantage of the fact that the error signal generally has a Laplacian (two-sided geometric) distribution, and that there are a set of special Huffman codes called Rice codes that can be used to efficiently encode these kind of signals quickly and without needing a dictionary.
178 </P>
179 <P>
180 Rice coding involves finding a single parameter that matches a signal's distribution, then using that parameter to generate the codes. As the distribution changes, the optimal parameter changes, so FLAC supports a method that allows the parameter to change as needed. The residual can be broken into several <I>contexts</I> or <I>partitions</I>, each with it's own Rice parameter. <B><TT>flac</TT></B> allows you to specify how the partitioning is done with the <TT>-r</TT> option. The residual can be broken into 2^<I>n</I> partitions, by using the option <TT>-r n,n</TT>. The parameter <I>n</I> is called the <I>partition order</I>. Furthermore, the encoder can be made to search through <I>m</I> to <I>n</I> partition orders, taking the best one, by specifying <TT>-r m,n</TT>. Generally, the choice of n does not affect encoding speed but m,n does. The larger the difference between m and n, the more time it will take the encoder to search for the best order. The block size will also affect the optimal order.
181 </P>
182 <P>
183 <B>FRAMING</B>
184 </P>
185 <P>
186 An audio frame is preceded by a frame header and trailed by a frame footer. The header starts with a sync code, and contains the minimum information necessary for a decoder to play the stream, like sample rate, bits per sample, etc. It also contains the block or sample number and an 8-bit CRC of the frame header. The sync code, frame header CRC, and block/sample number allow resynchronization and seeking even in the absence of seek points. The frame footer contains a 16-bit CRC of the entire encoded frame for error detection. If the reference decoder detects a CRC error it will generate a silent block.
187 </P>
188 <P>
189 <B>MISCELLANEOUS</B>
190 </P>
191 <P>
Josh Coalson2ec78112003-01-14 07:00:27 +0000192 In order to support come common types of metadata, the reference decoder knows how to skip <A HREF="http://www.id3.org/">ID3v1 and ID3v2 tags</A>. Note however that the FLAC specification does not require compliant implementations to support ID3 in any form. The XMMS and Winamp plugins support them out of convenience but other applications need not.
Josh Coalson5e5fc012002-07-16 16:09:53 +0000193 </P>
194 <P>
195 <B><TT>flac</TT></B> has a verify option <TT>-V</TT> that verifies the output while encoding. With this option, a decoder is run in parallel to the encoder and its output is compared against the original input. If a difference is found <B><TT>flac</TT></B> will stop with an error.
196 </P>
197 </FONT>
198 </TD></TR>
199 </TABLE>
200 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
201</TD></TR>
202</TABLE>
203
204
205<TABLE WIDTH="100%" CELLPADDING="5" CELLSPACING="5" BORDER="0">
206<TR><TD>
207 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
208 <TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#D3D4C5">
209 <TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
210 <A NAME="flac"><B><FONT SIZE="+2">flac</FONT></B>
211 </FONT></TD></TR>
212 </TABLE>
213 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
214 <TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#EEEED4">
215 <TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
216 <P>
Josh Coalsonade92342002-07-19 05:35:30 +0000217 <B><TT>flac</TT></B> is the command-line file encoder/decoder. The input to the encoder and the output to the decoder must either be RIFF WAVE format, AIFF, or raw interleaved sample data. <B><TT>flac</TT></B> only supports linear PCM samples (in other words, no A-LAW, uLAW, etc.). Another restriction (hopefully short-term) is that the input must be 8, 16, or 24 bits per sample. This is not a limitation of the FLAC format, just the reference encoder/decoder.
Josh Coalson5e5fc012002-07-16 16:09:53 +0000218 </P>
219 <P>
Josh Coalsonade92342002-07-19 05:35:30 +0000220 <B><TT>flac</TT></B> assumes that files ending in ".wav" or that have the RIFF WAVE header present are WAVE files, and files ending in ".aif" or ".aiff" or have the AIFF header present are in AIFF files. This may be overridden with a command-line option. It also assumes that files ending in ".ogg" are Ogg-FLAC files. Other than this, <B><TT>flac</TT></B> makes no assumptions about file extensions, though the convention is that FLAC files have the extension ".flac" (or ".fla" on ancient file systems like FAT-16).
Josh Coalson5e5fc012002-07-16 16:09:53 +0000221 </P>
222 <P>
223 Before going into the full command-line description, a few other things help to sort it out: 1) <B><TT>flac</TT></B> encodes by default, so you must use <B>-d</B> to decode; 2) the options <B><TT>-0</TT></B> .. <B><TT>-8</TT></B> (or <B><TT>--fast</B></TT> and <B><TT>--best</B></TT>) that control the compression level actually are just synonyms for different groups of specific encoding options (described later) and you can get the same effect by using the same options; 3) <B><TT>flac</TT></B> behaves similarly to gzip in the way it handles input and output files.
224 </P>
225 <P>
226 <B><TT>flac</TT></B> will be invoked one of four ways, depending on whether you are encoding, decoding, testing, or analyzing:
227 <UL>
228 <LI>
Josh Coalsoneb0ccd62002-12-21 04:38:59 +0000229 Encoding: flac [<I><A HREF="#general_options">&lt;general-options&gt;</A></I>] [<I><A HREF="#format_options">&lt;format-options&gt;</A></I>] [<I><A HREF="#encoding_options">&lt;encoding options&gt;</A></I>] [inputfile [...]]
Josh Coalson5e5fc012002-07-16 16:09:53 +0000230 </LI>
231 <LI>
Josh Coalsonadcc4a12002-12-21 04:50:22 +0000232 Decoding: flac -d [<I><A HREF="#general_options">&lt;general-options&gt;</A></I>] [<I><A HREF="#format_options">&lt;format-options&gt;</A></I>] [<I><A HREF="#decoding_options">&lt;decoding options&gt;</A></I>] [FLACfile [...]]
Josh Coalson5e5fc012002-07-16 16:09:53 +0000233 </LI>
234 <LI>
Josh Coalsoneb0ccd62002-12-21 04:38:59 +0000235 Testing: flac -t [<I><A HREF="#general_options">&lt;general-options&gt;</A></I>] [FLACfile [...]]
Josh Coalson5e5fc012002-07-16 16:09:53 +0000236 </LI>
237 <LI>
Josh Coalsoneb0ccd62002-12-21 04:38:59 +0000238 Analyzing: flac -a [<I><A HREF="#general_options">&lt;general-options&gt;</A></I>] [<I><A HREF="#analysis_options">&lt;analysis-options&gt;</A></I>] [FLACfile [...]]
Josh Coalson5e5fc012002-07-16 16:09:53 +0000239 </LI>
240 </UL>
241 </P>
242 <P>
243 In any case, if no <TT>inputfile</TT> is specified, stdin is assumed. If only one inputfile is specified, it may be "-" for stdin. When stdin is used as input, <B><TT>flac</TT></B> will write to stdout. Otherwise <B><TT>flac</TT></B> will perform the desired operation on each input file to similarly named output files (meaning for encoding, the extension will be replaced with ".flac", or appended with ".flac" if the input file has no extension, and for decoding, the extension will be ".wav" for WAVE output and ".raw" for raw output). The original file is not deleted unless --delete-input-file is specified.
244 </P>
245 <P>
246 If you are encoding/decoding from stdin to a file, you should use the -o option like so:
247 <UL>
248 <LI>
249 flac [options] -o outputfile
250 </LI>
251 <LI>
252 flac -d [options] -o outputfile
253 </LI>
254 </UL>
255 which are better than:
256 <UL>
257 <LI>
258 flac [options] &gt; outputfile
259 </LI>
260 <LI>
261 flac -d [options] &gt; outputfile
262 </LI>
263 </UL>
264 since the former allows flac to seek backwards to write the STREAMINFO or RIFF WAVE header contents when necessary.
265 </P>
266 <P>
267 Also, you can force output data to go to stdout using <TT>-c</TT>.
268 </P>
Josh Coalsonb5e8edd2003-08-28 21:36:15 +0000269 <P>
270 To encode or decode files that start with a dash, use <TT>--</TT> to signal the end of options, to keep the filenames themselves from being treated as options:
271 <UL>
272 <LI>
273 <TT>flac -V -- -01-filename.wav</TT>
274 </LI>
275 </UL>
276 </P>
Josh Coalsonade92342002-07-19 05:35:30 +0000277 <P>The encoding options affect the compression ratio and encoding speed. The format options are used to tell <B><TT>flac</TT></B> the arrangement of samples if the input file (or output file when decoding) is a raw file. If it is a RIFF WAVE or AIFF file the format options are not needed since they are read from the AIFF/WAVE header.
Josh Coalson5e5fc012002-07-16 16:09:53 +0000278 </P>
279 <P>
280 In test mode, <B><TT>flac</TT></B> acts just like in decode mode, except no output file is written. Both decode and test modes detect errors in the stream, but they also detect when the MD5 signature of the decoded audio does not match the stored MD5 signature, even when the bitstream is valid.
281 </P>
282 <P>
283 <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" BGCOLOR="#EEEED4"><TR><TD>
284 <TABLE WIDTH="100%" BORDER="1" BGCOLOR="#EEEED4">
285 <TR>
286 <TD COLSPAN="2" BGCOLOR="#D3D4C5">
287 <A NAME="general_options"><FONT SIZE="+1"><B>General Options</B></FONT></A>
288 </TD>
289 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000290 <A NAME="flac_options_version">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000291 <TR>
292 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalson3cf909c2002-08-20 03:57:59 +0000293 <TT>-v</TT>, <TT>--version</TT>
294 </TD>
295 <TD>
296 Show the <B><TT>flac</TT></B> version number.
297 </TD>
298 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000299 <A NAME="flac_options_help">
Josh Coalson3cf909c2002-08-20 03:57:59 +0000300 <TR>
301 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000302 <TT>-h</TT>, <TT>--help</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000303 </TD>
304 <TD>
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000305 Show basic usage and a list of all options. Running <B><TT>flac</TT></B> without arguments shows the short help screen by default.
Josh Coalson5e5fc012002-07-16 16:09:53 +0000306 </TD>
307 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000308 <A NAME="flac_options_explain">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000309 <TR>
310 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000311 <TT>-H</TT>, <TT>--explain</TT>
312 </TD>
313 <TD>
314 Show detailed explanation of usage and all options. Running <B><TT>flac</TT></B> without arguments shows the short help screen by default.
315 </TD>
316 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000317 <A NAME="flac_options_decode">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000318 <TR>
319 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
320 <TT>-d</TT>, <TT>--decode</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000321 </TD>
322 <TD>
323 Decode (<B><TT>flac</TT></B> encodes by default). <B><TT>flac</TT></B> will exit with an exit code of <TT>1</TT> (and print a message, even in silent mode) if there were any errors during decoding, including when the MD5 checksum does not match the decoded output. Otherwise the exit code will be <TT>0</TT>.
324 </TD>
325 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000326 <A NAME="flac_options_test">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000327 <TR>
328 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000329 <TT>-t</TT>, <TT>--test</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000330 </TD>
331 <TD>
332 Test (same as <B><TT>-d</TT></B> except no decoded file is written). The exit codes are the same as in decode mode.
333 </TD>
334 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000335 <A NAME="flac_options_analyze">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000336 <TR>
337 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000338 <TT>-a</TT>, <TT>--analyze</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000339 </TD>
340 <TD>
341 Analyze (same as <B><TT>-d</TT></B> except an analysis file is written). The exit codes are the same as in decode mode. This option is mainly for developers; the output will be a text file that has data about each frame and subframe.
342 </TD>
343 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000344 <A NAME="flac_options_stdout">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000345 <TR>
346 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000347 <TT>-c</TT>, <TT>--stdout</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000348 </TD>
349 <TD>
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000350 Write output to stdout.
Josh Coalson5e5fc012002-07-16 16:09:53 +0000351 </TD>
352 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000353 <A NAME="flac_options_silent">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000354 <TR>
355 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000356 <TT>-s</TT>, <TT>--silent</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000357 </TD>
358 <TD>
359 Silent: do not show encoding/decoding statistics.
360 </TD>
361 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000362 <A NAME="flac_options_totally_silent">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000363 <TR>
364 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsone4240db2004-07-17 18:14:45 +0000365 <TT>--totally-silent</TT>
366 </TD>
367 <TD>
368 Do not print anything of any kind, including warnings or errors. The exit code will be the only way to determine successful completion.
369 </TD>
370 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000371 <A NAME="flac_options_force">
Josh Coalsone4240db2004-07-17 18:14:45 +0000372 <TR>
373 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalson080d54b2004-07-16 00:11:36 +0000374 <TT>-f</TT>, <TT>--force</TT>
375 </TD>
376 <TD>
377 Force overwriting of output files. By default, <TT><B>flac</B></TT> warns that the output file already exists and continues to the next file.
378 </TD>
379 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000380 <A NAME="flac_options_output_name">
Josh Coalson080d54b2004-07-16 00:11:36 +0000381 <TR>
382 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalson3beadb62002-08-13 21:42:00 +0000383 <TT>-o filename</TT>,<BR><TT>--output-name=filename</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000384 </TD>
385 <TD>
386 Force the output file name (usually <TT><B>flac</B></TT> just changes the extension). May only be used when encoding a single file. May not be used in conjunction with <TT>--output-prefix</T>.
387 </TD>
388 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000389 <A NAME="flac_options_output_prefix">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000390 <TR>
391 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000392 <TT>--output-prefix=string</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000393 </TD>
394 <TD>
395 Prefix each output file name with the given string. This can be useful for encoding/decoding files to a different directory. Make sure if your string is a path name that it ends with a trailing '<TT>/</TT>' slash.
396 </TD>
397 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000398 <A NAME="flac_options_delete_input_file">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000399 <TR>
400 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
401 <TT>--delete-input-file</TT>
402 </TD>
403 <TD>
404 Automatically delete the input file after a successful encode or decode. If there was an error (including a verify error) the input file is left intact.
405 </TD>
406 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000407 <A NAME="flac_options_skip">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000408 <TR>
409 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalson99060562002-12-21 03:28:06 +0000410 <TT>--skip={#|mm:ss.ss}</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000411 </TD>
412 <TD>
Josh Coalson99060562002-12-21 03:28:06 +0000413 Skip over the first # of samples of the input. This works for both encoding and decoding, but not testing. The alternative form <TT>mm:ss.ss</TT> can be used to specify minutes, seconds, and fractions of a second.<P>
414 Examples:<P>
415 <TT>--skip=123</TT> : skip the first 123 samples of the input<P>
Josh Coalsonadcc4a12002-12-21 04:50:22 +0000416 <TT>--skip=1:23.45</TT> : skip the first 1 minute and 23.45 seconds of the input
Josh Coalson99060562002-12-21 03:28:06 +0000417 </TD>
418 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000419 <A NAME="flac_options_until">
Josh Coalson99060562002-12-21 03:28:06 +0000420 <TR>
421 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
422 <TT>--until={#|[+|-]mm:ss.ss}</TT>
423 </TD>
424 <TD>
Josh Coalsonadcc4a12002-12-21 04:50:22 +0000425 Stop at the given sample number for each input file. This works for both encoding and decoding, but not testing. The given sample number is not included in the decoded output. The alternative form <TT>mm:ss.ss</TT> can be used to specify minutes, seconds, and fractions of a second. If a <TT>+</TT> sign is at the beginning, the <TT>--until</TT> point is relative to the <TT>--skip</TT> point. If a <TT>-</TT> sign is at the beginning, the <TT>--until</TT> point is relative to end of the audio.<P>
Josh Coalson99060562002-12-21 03:28:06 +0000426 Examples:<P>
427 <TT>--until=123</TT> : decode only the first 123 samples of the input (samples 0-122, stopping at 123)<P>
428 <TT>--until=1:23.45</TT> : decode only the first 1 minute and 23.45 seconds of the input<P>
Josh Coalsonadcc4a12002-12-21 04:50:22 +0000429 <TT>--skip=1:00 --until=+1:23.45</TT> : decode 1:00.00 to 2:23.45<P>
Josh Coalson99060562002-12-21 03:28:06 +0000430 <TT>--until=-1:23.45</TT> : decode everything except the last 1 minute and 23.45 seconds<P>
431 <TT>--until=-0:00</TT> : decode until the end of the input (the same as not specifying <TT>--until</TT>)
Josh Coalson5e5fc012002-07-16 16:09:53 +0000432 </TD>
433 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000434 <A NAME="flac_options_ogg">
Josh Coalsonf3911322002-09-20 05:53:10 +0000435 <TR>
436 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
437 <TT>--ogg</TT>
438 </TD>
439 <TD>
440 When encoding, generate Ogg-FLAC output instead of native-FLAC. Ogg-FLAC streams are FLAC streams wrapped in an Ogg transport layer. The resulting file should have an '.ogg' extension and will still be decodable by <TT><B>flac</B></TT>.<P>
441 When decoding, force the input to be treated as Ogg-FLAC. This is useful when piping input from stdin or when the filename does not end in '.ogg'.
442 </TD>
443 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000444 <A NAME="flac_options_serial_number">
Josh Coalsonf3911322002-09-20 05:53:10 +0000445 <TR>
446 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
447 <TT>--serial-number=#</TT>
448 </TD>
449 <TD>
Josh Coalson03a5a692004-07-17 00:23:17 +0000450 When used with --ogg, specifies the serial number to use for the first Ogg FLAC stream, which is then incremented for each additional stream. When encoding and no serial number is given, <TT><B>flac</B></TT> uses a random number for the first stream, then increments it for each additional stream. When decoding and no number is given, <TT><B>flac</B></TT> uses the serial number of the first page.
Josh Coalsonf3911322002-09-20 05:53:10 +0000451 </TD>
452 </TR>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000453 </TABLE>
454 </TD></TR></TABLE>
455 </P>
456 <P>
457 <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" BGCOLOR="#EEEED4"><TR><TD>
458 <TABLE WIDTH="100%" BORDER="1" BGCOLOR="#EEEED4">
459 <TR>
460 <TD COLSPAN="2" BGCOLOR="#D3D4C5">
461 <A NAME="analysis_options"><FONT SIZE="+1"><B>Analysis Options</B></FONT></A>
462 </TD>
463 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000464 <A NAME="flac_options_residual_text">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000465 <TR>
466 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000467 <TT>--residual-text</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000468 </TD>
469 <TD>
470 Includes the residual signal in the analysis file. This will make the file <B>very</B> big, much larger than even the decoded file.
471 </TD>
472 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000473 <A NAME="flac_options_residual_gnuplot">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000474 <TR>
475 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000476 <TT>--residual-gnuplot</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000477 </TD>
478 <TD>
479 Generates a gnuplot file for every subframe; each file will contain the residual distribution of the subframe. This will create a <B>lot</B> of files.
480 </TD>
481 </TR>
482 </TABLE>
483 </TD></TR></TABLE>
484 </P>
485 <P>
486 <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" BGCOLOR="#EEEED4"><TR><TD>
487 <TABLE WIDTH="100%" BORDER="1" BGCOLOR="#EEEED4">
488 <TR>
489 <TD COLSPAN="2" BGCOLOR="#D3D4C5">
490 <A NAME="decoding_options"><FONT SIZE="+1"><B>Decoding Options</B></FONT></A>
491 </TD>
492 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000493 <A NAME="flac_options_cue">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000494 <TR>
495 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalson03a5a692004-07-17 00:23:17 +0000496 <TT>--cue=[#.#][-[#.#]]</TT>
497 </TD>
498 <TD>
499 Set the beginning and ending cuepoints to decode. The optional first <TT>#.#</TT> is the track and index point at which decoding will start; the default is the beginning of the stream. The optional second <TT>#.#</TT> is the track and index point at which decoding will end; the default is the end of the stream. If the seekpoint does not exist, the closest one before it (for the start point) or after it (for the end point) will be used. If those don't exist, the start of the stream (for the start point) or end of the stream (for the end point) will be used. The cuepoints are merely translated into sample numbers then used as --skip and --until.<P>
500 Examples:<P>
501 <TT>--cue=-</TT> : decode the entire stream<P>
502 <TT>--cue=4.1</TT> : decode from track 4, index 1 to the end of the stream<P>
503 <TT>--cue=4.1-</TT> : decode from track 4, index 1 to the end of the stream<P>
504 <TT>--cue=-4.1</TT> : decode from the beginning of the stream up to, but not including, track 4, index 1<P>
505 <TT>--cue=2.1-2.4</TT> : decode from track 2, index 1, up to, but not including, track 2, index 4<P>
506 </TD>
507 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000508 <A NAME="flac_options_decode_through_errors">
Josh Coalson03a5a692004-07-17 00:23:17 +0000509 <TR>
510 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalson992009a2002-08-13 21:47:44 +0000511 <TT>-F</TT>,<BR><TT>--decode-through-errors</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000512 </TD>
513 <TD>
514 By default <B><TT>flac</TT></B> stops decoding with an error and removes the partially decoded file if it encounters a bitstream error. With <TT>-F</TT>, errors are still printed but <B><TT>flac</TT></B> will continue decoding to completion. Note that errors may cause the decoded audio to be missing some samples or have silent sections.
515 </TD>
516 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000517 <!-- @@@ undocumented, also not in the man page yet
518 <A NAME="flac_options_apply_replaygain_which_is_not_lossless">
519 <TR>
520 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
521 <TT>--apply-replaygain_which_is_not_lossless[=&lt;specification&gt;]</TT>
522 </TD>
523 <TD>
524 Applies ReplayGain values while decoding.
525 <P>
526 <B>WARNING: THIS IS NOT LOSSLESS. DECODED AUDIO WILL NOT BE IDENTICAL TO THE ORIGINAL WITH THIS OPTION</B>.
527 <P>
528 The equals sign and &lt;specification&gt; is optional. If omitted, the default is <TT>0aLn1</TT>.
529 <P>
530 The <TT>&lt;specification&gt;</TT> is a shorthand notation for describing how to apply ReplayGain. All components are optional but order is important. '<TT>[]</TT>' means 'optional'. '<TT>|</TT>' means 'or'. '<TT>{}</TT>' means required. The format is:<P>
531 &nbsp;&nbsp;<TT>[&lt;preamp&gt;][a|t][l|L][n{0|1|2|3}]</TT>
532 <P>
533 <UL>
534 <LI>
535 <TT>&lt;preamp&gt;</TT><P>
536 &nbsp;&nbsp;A floating point number in dB. This is added to the existing gain value.
537 </LI>
538 <LI>
539 <TT>a|t</TT><P>
540 &nbsp;&nbsp;Specify '<TT>a</TT>' to use the album gain, or '<TT>t</TT>' to use the track gain
541 </LI>
542 <LI>
543 <TT>l|L</TT><P>
544 &nbsp;&nbsp;Specify '<TT>l</TT>' to peak-limit the output, so that the ReplayGain peak value is full-scale. Specify '<TT>L</TT>' to use a 6dB hard limiter that kicks in when the signal approaches full-scale.
545 </LI>
546 <LI>
547 <TT>n{0|1|2|3}</TT><P>
548 &nbsp;&nbsp;Specify the amount of noise shaping. ReplayGain synthesis happens in floating point; the result is dithered before converting back to integer. This quantization adds noise. Noise shaping tries to move the noise where you won't hear it as much. <TT>0</TT> means no noise shaping, <TT>1</TT> means 'low', <TT>2</TT> means 'medium', <TT>3</TT> means 'high'.
549 </LI>
550 </UL>
551 <P>
552 For example, the default of <TT>0aLn1</TT> means 0dB preamp, use album gain, 6dB hard limit, low noise shaping.
553 <P>
554 <TT>--apply-replaygain-which-is-not-lossless=3</TT> means 3dB preamp, use album gain, no limiting, no noise shaping.
555 <P>
556 <B><TT>flac</B></TT> uses the ReplayGain tags for the calculation. If a stream does not have the required tags or they can't be parsed, decoding will continue with a warning, and no ReplayGain is applied to that stream.
557 </TD>
558 </TR>
559 -->
Josh Coalson5e5fc012002-07-16 16:09:53 +0000560 </TABLE>
561 </TD></TR></TABLE>
562 </P>
563 <P>
564 <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" BGCOLOR="#EEEED4"><TR><TD>
565 <TABLE WIDTH="100%" BORDER="1" BGCOLOR="#EEEED4">
566 <TR>
567 <TD COLSPAN="2" BGCOLOR="#D3D4C5">
568 <A NAME="encoding_options"><FONT SIZE="+1"><B>Encoding Options</B></FONT></A>
569 </TD>
570 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000571 <A NAME="flac_options_verify">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000572 <TR>
573 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000574 <TT>-V</TT>, <TT>--verify</TT>
575 </TD>
576 <TD>
577 Verify the encoding process. With this option, <B><TT>flac</TT></B> will create a parallel decoder that decodes the output of the encoder and compares the result against the original. It will abort immediately with an error if a mismatch occurs. <B><TT>-V</TT></B> increases the total encoding time but is guaranteed to catch any unforseen bug in the encoding process.
578 </TD>
579 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000580 <A NAME="flac_options_lax">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000581 <TR>
582 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000583 <TT>--lax</TT>
584 </TD>
585 <TD>
Josh Coalsonc136e9f2003-09-15 20:39:43 +0000586 Allow encoder to generate non-<A HREF="format.html#subset">Subset</A> files. The resulting FLAC file may not be streamable, so you should only use this option in combination with custom encoding options meant for archival. File decoders will still be able play (and seek in) such files.
Josh Coalson5e5fc012002-07-16 16:09:53 +0000587 </TD>
588 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000589 <A NAME="flac_options_replay_gain">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000590 <TR>
591 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalson853d79c2002-10-31 06:16:45 +0000592 <TT>--replay-gain</TT>
593 </TD>
594 <TD>
Josh Coalson6a6be372004-09-08 00:58:46 +0000595 Calculate <A HREF="http://www.replaygain.org/">ReplayGain</A> values and store in FLAC tags, similar to <A HREF="http://packages.qa.debian.org/v/vorbisgain.html">VorbisGain</A>. Title gains/peaks will be computed for each input file, and an album gain/peak will be computed for all files. All input files must have the same resolution, sample rate, and number of channels. Only mono and stereo files are allowed, and the sample rate must be one of 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, or 48 kHz. Also note that this option may leave a few extra bytes in a PADDING block as the exact size of the tags is not known until all files are processed.<P>
Josh Coalson853d79c2002-10-31 06:16:45 +0000596 Note that this option cannot be used when encoding to standard output (stdout).
597 </TD>
598 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000599 <A NAME="flac_options_cuesheet">
Josh Coalson853d79c2002-10-31 06:16:45 +0000600 <TR>
601 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalson99060562002-12-21 03:28:06 +0000602 <TT>--cuesheet=FILENAME</TT>
603 </TD>
604 <TD>
Josh Coalsonadcc4a12002-12-21 04:50:22 +0000605 Import the given cuesheet file and store it in a <A HREF="format.html#def_CUESHEET">CUESHEET</A> metadata block. This option may only be used when encoding a single file. A seekpoint will be added for each index point in the cuesheet to the <A HREF="format.html#def_SEEKTABLE">SEEKTABLE</A> unless <TT>--no-cued-seekpoints</TT> is specified.<P>
Josh Coalson99060562002-12-21 03:28:06 +0000606 The cuesheet file must be of the sort written by <A HREF="http://www.goldenhawk.com/cdrwin.htm">CDRwin</A>, <A HREF="http://www.dcsoft.com/prod03.htm">CDRcue</A>, <A HREF="http://www.exactaudiocopy.de/">EAC</A>, et al.
607 </TD>
608 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000609 <A NAME="flac_options_sector_align">
Josh Coalson99060562002-12-21 03:28:06 +0000610 <TR>
611 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000612 <TT>--sector-align</TT>
613 </TD>
614 <TD>
615 Align encoding of multiple CD format WAVE files on sector boundaries. This option is only allowed when encoding WAVE files, all of which have a 44.1kHz sample rate and 2 channels. With <TT>--sector-align</TT>, the encoder will align the resulting .flac streams so that their lengths are even multiples of a CD sector (1/75th of a second, or 588 samples). It does this by carrying over any partial sector at the end of each WAVE file to the next stream. The last stream will be padded to alignment with zeroes.<P>
616 This option will have no effect if the files are already aligned (as is the normally the case with WAVE files ripped from a CD). <TT><B>flac</B></TT> can only align a set of files given in one invocation of <TT><B>flac</B></TT>.<P>
617 <B>WARNING:</B> The ordering of files is important! If you give a command like '<TT>flac --sector-align *.wav</TT>' the shell may not expand the wildcard to the order you expect. To be safe you should '<TT>echo *.wav</TT>' first to confirm the order, or be explicit like '<TT>flac --sector-align 8.wav 9.wav 10.wav</TT>'.
618 </TD>
619 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000620 <A NAME="flac_options_seekpoint">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000621 <TR>
622 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalson0dad1632002-11-07 05:06:36 +0000623 <TT>-S {#|X|#x|#s}</TT>,<BR><TT>--seekpoint={#|X|#x|#s}</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000624 </TD>
625 <TD>
626 Include a point or points in a SEEKTABLE:<BR>
627 <UL>
628 <LI>
629 <TT>#&nbsp;</TT> : a specific sample number for a seek point
630 </LI>
631 <LI>
632 <TT>X&nbsp;</TT> : a placeholder point (always goes at the end of the SEEKTABLE)
633 </LI>
634 <LI>
635 <TT>#x</TT> : # evenly spaced seekpoints, the first being at sample 0
636 </LI>
Josh Coalson0dad1632002-11-07 05:06:36 +0000637 <LI>
638 <TT>#s</TT> : a seekpoint every # seconds; # does not have to be a whole number, it can be, for example, <TT>9.5</TT>, meaning a seekpoint every 9.5 seconds
639 </LI>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000640 </UL>
641 You may use many -S options; the resulting SEEKTABLE will be the unique-ified union of all such values.<BR>
Josh Coalsona86b5ef2002-12-31 00:08:31 +0000642 With no -S options, flac defaults to '-S 10s'. Use --no-seektable for no SEEKTABLE.<BR>
Josh Coalson0dad1632002-11-07 05:06:36 +0000643 <B>NOTE:</B> -S #x and -S #s will not work if the encoder can't determine the input size before starting.<BR>
Josh Coalson1ce20b62002-10-23 22:18:37 +0000644 <B>NOTE:</B> if you use -S # and # is &gt;= samples in the input, there will be either no seek point entered (if the input size is determinable before encoding starts) or a placeholder point (if input size is not determinable).<BR>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000645 </TD>
646 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000647 <A NAME="flac_options_padding">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000648 <TR>
649 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000650 <TT>-P #</TT>, <TT>--padding=#</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000651 </TD>
652 <TD>
Josh Coalson61fd93f2003-01-11 06:28:44 +0000653 Tell the encoder to write a <TT>PADDING</TT> metadata block of the given length (in bytes) after the <TT>STREAMINFO</TT> block. This is useful if you plan to tag the file later with an <TT>APPLICATION</TT> block; instead of having to rewrite the entire file later just to insert your block, you can write directly over the <TT>PADDING</TT> block. Note that the total length of the <TT>PADDING</TT> block will be 4 bytes longer than the length given because of the 4 metadata block header bytes. You can force no <TT>PADDING</TT> block at all to be written with <TT>--no-padding</TT>. The encoder writes a PADDING block of 4096 bytes by default.
Josh Coalson5e5fc012002-07-16 16:09:53 +0000654 </TD>
655 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000656 <A NAME="flac_options_tag">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000657 <TR>
658 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonf3911322002-09-20 05:53:10 +0000659 <TT>-T FIELD=VALUE</TT>, <TT>--tag=FIELD=VALUE</TT>
660 </TD>
661 <TD>
Josh Coalson6a6be372004-09-08 00:58:46 +0000662 Add a FLAC tag. The comment must adhere to the Vorbis comment spec (which FLAC tags implement), i.e. the FIELD must contain only legal characters, terminated by an 'equals' sign. Make sure to quote the comment if necessary. This option may appear more than once to add several comments. NOTE: all tags will be added to all encoded files.
Josh Coalsonf3911322002-09-20 05:53:10 +0000663 </TD>
664 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000665 <A NAME="flac_options_blocksize">
Josh Coalsonf3911322002-09-20 05:53:10 +0000666 <TR>
667 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000668 <TT>-b #</TT>, <TT>--blocksize=#</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000669 </TD>
670 <TD>
671 Specify the block size in samples. The default is 1152 for -l 0, otherwise 4608. Subset streams must use one of 192/576/1152/2304/4608/256/512/1024/2048/4096/8192/16384/32768. The reference encoder uses the same block size for the entire stream.
672 </TD>
673 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000674 <A NAME="flac_options_mid_side">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000675 <TR>
676 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000677 <TT>-m</TT>, <TT>--mid-side</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000678 </TD>
679 <TD>
Josh Coalson1ce20b62002-10-23 22:18:37 +0000680 Enable mid-side coding (only for stereo streams). Tends to increase compression by a few percent on average. For each block both the stereo pair and mid-side versions of the block will be encoded, and smallest resulting frame will be stored. Currently mid-side encoding is only available when bits-per-sample &lt;= 16.
Josh Coalson5e5fc012002-07-16 16:09:53 +0000681 </TD>
682 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000683 <A NAME="flac_options_adaptive_mid_side">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000684 <TR>
685 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000686 <TT>-M</TT>, <TT>--adaptive-mid-side</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000687 </TD>
688 <TD>
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000689 Enable adaptive mid-side coding (only for stereo streams). Like <TT>-m</TT> but the encoder adaptively switches between independent and mid-side coding, which is faster but yields less compression than <TT>-m</TT> (which does an exhaustive search).
Josh Coalson5e5fc012002-07-16 16:09:53 +0000690 </TD>
691 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000692 <A NAME="flac_options_levels">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000693 <TR>
694 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalson3beadb62002-08-13 21:42:00 +0000695 <TT>-0 .. -8</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000696 </TD>
697 <TD>
698 Fastest compression .. highest compression. The default is <TT>-5</TT>.
699 </TD>
700 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000701 <A NAME="flac_options_level_0">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000702 <TR>
703 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000704 <TT>-0</TT>, <TT>--compression-level-0</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000705 </TD>
706 <TD>
707 Synonymous with <TT>-l 0 -b 1152 -r 2,2</TT>
708 </TD>
709 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000710 <A NAME="flac_options_level_1">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000711 <TR>
712 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000713 <TT>-1</TT>, <TT>--compression-level-1</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000714 </TD>
715 <TD>
716 Synonymous with <TT>-l 0 -b 1152 -M -r 2,2</TT>
717 </TD>
718 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000719 <A NAME="flac_options_level_2">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000720 <TR>
721 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000722 <TT>-2</TT>, <TT>--compression-level-2</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000723 </TD>
724 <TD>
725 Synonymous with <TT>-l 0 -b 1152 -m -r 3</TT>
726 </TD>
727 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000728 <A NAME="flac_options_level_3">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000729 <TR>
730 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000731 <TT>-3</TT>, <TT>--compression-level-3</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000732 </TD>
733 <TD>
734 Synonymous with <TT>-l 6 -b 4608 -r 3,3</TT>
735 </TD>
736 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000737 <A NAME="flac_options_level_4">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000738 <TR>
739 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000740 <TT>-4</TT>, <TT>--compression-level-4</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000741 </TD>
742 <TD>
743 Synonymous with <TT>-l 8 -b 4608 -M -r 3,3</TT>
744 </TD>
745 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000746 <A NAME="flac_options_level_5">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000747 <TR>
748 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000749 <TT>-5</TT>, <TT>--compression-level-5</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000750 </TD>
751 <TD>
752 Synonymous with <TT>-l 8 -b 4608 -m -r 3,3</TT>
753 </TD>
754 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000755 <A NAME="flac_options_level_6">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000756 <TR>
757 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000758 <TT>-6</TT>, <TT>--compression-level-6</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000759 </TD>
760 <TD>
761 Synonymous with <TT>-l 8 -b 4608 -m -r 4</TT>
762 </TD>
763 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000764 <A NAME="flac_options_level_7">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000765 <TR>
766 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000767 <TT>-7</TT>, <TT>--compression-level-7</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000768 </TD>
769 <TD>
770 Synonymous with <TT>-l 8 -b 4608 -m -e -r 6</TT>
771 </TD>
772 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000773 <A NAME="flac_options_level_8">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000774 <TR>
775 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000776 <TT>-8</TT>, <TT>--compression-level-8</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000777 </TD>
778 <TD>
779 Synonymous with <TT>-l 12 -b 4608 -m -e -r 6</TT>
780 </TD>
781 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000782 <A NAME="flac_options_fast">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000783 <TR>
784 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
785 <TT>--fast</TT>
786 </TD>
787 <TD>
788 Fastest compression. Currently synonymous with <TT>-0</TT>
789 </TD>
790 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000791 <A NAME="flac_options_best">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000792 <TR>
793 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
794 <TT>--best</TT>
795 </TD>
796 <TD>
797 Highest compression. Currently synonymous with <TT>-8</TT>
798 </TD>
799 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000800 <A NAME="flac_options_exhaustive_model_search">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000801 <TR>
802 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalson992009a2002-08-13 21:47:44 +0000803 <TT>-e</TT>,<BR><TT>--exhaustive-model-search</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000804 </TD>
805 <TD>
806 Exhaustive model search (expensive!). Normally the encoder estimates the best model to use and encodes once based on the estimate. With an exhaustive model search, the encoder will generate subframes for every order and use the smallest. If the max LPC order is high this can significantly increase the encode time but can shave off another 0.5%.
807 </TD>
808 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000809 <A NAME="flac_options_max_lpc_order">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000810 <TR>
811 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000812 <TT>-l #</TT>, <TT>--max-lpc-order=#</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000813 </TD>
814 <TD>
Josh Coalson1ce20b62002-10-23 22:18:37 +0000815 Specifies the maximum LPC order. This number must be &lt;= 32. If 0, the encoder will not attempt generic linear prediction, and use only fixed predictors. Using fixed predictors is faster but usually results in files being 5-10% larger.
Josh Coalson5e5fc012002-07-16 16:09:53 +0000816 </TD>
817 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000818 <A NAME="flac_options_qlp_coeff_precision">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000819 <TR>
820 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalson992009a2002-08-13 21:47:44 +0000821 <TT>-q #</TT>,<BR><TT>--qlp-coeff-precision=#</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000822 </TD>
823 <TD>
824 Specifies the precision of the quantized LP coefficients, in bits. The default is <B><TT>-q 0</TT></B>, which means let the encoder decide based on the signal. Unless you really know your input file it's best to leave this up to the encoder.
825 </TD>
826 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000827 <A NAME="flac_options_qlp_coeff_precision_search">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000828 <TR>
829 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalson992009a2002-08-13 21:47:44 +0000830 <TT>-p</TT>,<BR><TT>--qlp-coeff-precision-search</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000831 </TD>
832 <TD>
833 Do exhaustive LP coefficient quantization optimization. This option overrides any <B><TT>-q</TT></B> option. It is expensive and typically will only improve the compression a tiny fraction of a percent. <B><TT>-q</TT></B> has no effect when <B><TT>-l 0</TT></B> is used.
834 </TD>
835 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000836 <A NAME="flac_options_rice_partition_order">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000837 <TR>
838 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalson992009a2002-08-13 21:47:44 +0000839 <TT>-r [#,]#</TT>,<BR><TT>--rice-partition-order=[#,]#</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000840 </TD>
841 <TD>
842 Set the [min,]max residual partition order. The min value defaults to 0 if unspecified.<P>
843 By default the encoder uses a single Rice parameter for the subframe's entire residual. With this option, the residual is iteratively partitioned into 2^min# .. 2^max# pieces, each with its own Rice parameter. Higher values of max# yield diminishing returns. The most bang for the buck is usually with <B><TT>-r 2,2</TT></B> (more for higher block sizes). This usually shaves off about 1.5%. The technique tends to peak out about when blocksize/(2^n)=128. Use <B><TT>-r 0,16</TT></B> to force the highest degree of optimization.
844 </TD>
845 </TR>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000846 </TABLE>
847 </TD></TR></TABLE>
848 </P>
849 <P>
850 <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" BGCOLOR="#EEEED4"><TR><TD>
851 <TABLE WIDTH="100%" BORDER="1" BGCOLOR="#EEEED4">
852 <TR>
853 <TD COLSPAN="2" BGCOLOR="#D3D4C5">
854 <A NAME="format_options"><FONT SIZE="+1"><B>Format Options</B></FONT></A>
855 </TD>
856 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000857 <A NAME="flac_options_endian">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000858 <TR>
859 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000860 <TT>--endian={big|little}</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000861 </TD>
862 <TD>
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000863 Specify big-endian or little-endian byte order in the raw file.
Josh Coalson5e5fc012002-07-16 16:09:53 +0000864 </TD>
865 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000866 <A NAME="flac_options_channels">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000867 <TR>
868 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000869 <TT>--channels=#</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000870 </TD>
871 <TD>
872 Specify the number of channels in the raw file.
873 </TD>
874 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000875 <A NAME="flac_options_bps">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000876 <TR>
877 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000878 <TT>--bps=#</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000879 </TD>
880 <TD>
881 Specify the number of bits per sample in the raw file.
882 </TD>
883 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000884 <A NAME="flac_options_sample_rate">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000885 <TR>
886 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000887 <TT>--sample-rate=#</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000888 </TD>
889 <TD>
890 Specify the sample rate of the raw file.
891 </TD>
892 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000893 <A NAME="flac_options_sign">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000894 <TR>
895 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000896 <TT>--sign={signed|unsigned}</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000897 </TD>
898 <TD>
Josh Coalsonee89a1e2002-08-13 21:35:05 +0000899 Specify that the samples in the raw file are signed or unsigned (the default is signed).
Josh Coalson5e5fc012002-07-16 16:09:53 +0000900 </TD>
901 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000902 <A NAME="flac_options_force_aiff_format">
Josh Coalson5e5fc012002-07-16 16:09:53 +0000903 <TR>
904 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalson99060562002-12-21 03:28:06 +0000905 <TT>--force-aiff-format</TT>
906 </TD>
907 <TD>
908 Force the decoder to output AIFF format. This option is not needed if the output filename (as set by -o) ends with .aiff. Also, this option has no effect when encoding since input AIFF is auto-detected.
909 </TD>
910 </TR>
Josh Coalsondf8fd272004-07-23 05:07:36 +0000911 <A NAME="flac_options_force_raw_format">
Josh Coalson99060562002-12-21 03:28:06 +0000912 <TR>
913 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
Josh Coalsoneb209032002-08-20 20:37:26 +0000914 <TT>--force-raw-format</TT>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000915 </TD>
916 <TD>
917 Treat the input file (or output file if decoding) as a raw file, regardless of the extension.
918 </TD>
919 </TR>
920 </TABLE>
921 </TD></TR></TABLE>
922 </P>
Josh Coalson3beadb62002-08-13 21:42:00 +0000923 <P>
924 <TABLE WIDTH="100%" BORDER="0" CELLSPACING="0" CELLPADDING="0" BGCOLOR="#EEEED4"><TR><TD>
925 <TABLE WIDTH="100%" BORDER="1" BGCOLOR="#EEEED4">
926 <TR>
927 <TD COLSPAN="2" BGCOLOR="#D3D4C5">
Josh Coalsondf8fd272004-07-23 05:07:36 +0000928 <A NAME="negative_options"><FONT SIZE="+1"><B>Negative Options</B></FONT></A>
Josh Coalson3beadb62002-08-13 21:42:00 +0000929 </TD>
930 </TR>
931 <TR>
932 <TD NOWRAP ALIGN="RIGHT" VALIGN="TOP" BGCOLOR="#F4F4CC">
933 <TT>--no-adaptive-mid-side</TT><BR>
934 <TT>--no-decode-through-errors</TT><BR>
935 <TT>--no-delete-input-file</TT><BR>
936 <TT>--no-escape-coding</TT><BR>
937 <TT>--no-exhaustive-model-search</TT><BR>
938 <TT>--no-lax</TT><BR>
939 <TT>--no-mid-side</TT><BR>
940 <TT>--no-ogg</TT><BR>
941 <TT>--no-padding</TT><BR>
942 <TT>--no-qlp-coeff-precision-search</TT><BR>
943 <TT>--no-residual-gnuplot</TT><BR>
944 <TT>--no-residual-text</TT><BR>
945 <TT>--no-sector-align</TT><BR>
946 <TT>--no-seektable</TT><BR>
947 <TT>--no-silent</TT><BR>
948 <TT>--no-verify</TT>
949 </TD>
950 <TD>
951 can all be used to turn off a particular option.
952 </TD>
953 </TR>
954 </TABLE>
955 </TD></TR></TABLE>
956 </P>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000957 </FONT>
958 </TD></TR>
959 </TABLE>
960 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
961</TD></TR>
962</TABLE>
963
964
965<TABLE WIDTH="100%" CELLPADDING="5" CELLSPACING="5" BORDER="0">
966<TR><TD>
967 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
968 <TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#D3D4C5">
969 <TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
970 <A NAME="metaflac"><B><FONT SIZE="+2">metaflac</FONT></B>
971 </FONT></TD></TR>
972 </TABLE>
973 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
974 <TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#EEEED4">
975 <TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
976 <P>
977 <B><TT>metaflac</TT></B> is the command-line <TT>.flac</TT> file metadata editor. You can use it to list the contents of blocks, delete or insert blocks, and manage padding.
978 </P>
979 <P>
Josh Coalson99060562002-12-21 03:28:06 +0000980 The HTML documentation for <B><TT>metaflac</TT></B> is currently being rewritten, but the usage screen should explain it pretty well, and there is a man page. Do <TT>metaflac --help</TT> to see the full usage.
Josh Coalson5e5fc012002-07-16 16:09:53 +0000981 </P>
982 </FONT>
983 </TD></TR>
984 </TABLE>
985 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
986</TD></TR>
987</TABLE>
988
989
990<A NAME="plugins"></A>
991<TABLE WIDTH="100%" CELLPADDING="5" CELLSPACING="5" BORDER="0">
992<TR><TD>
993 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
994 <TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#D3D4C5">
995 <TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
996 <A NAME="xmms_plugin"><B><FONT SIZE="+2">xmms plugin</FONT></B></A>
997 </FONT></TD></TR>
998 </TABLE>
999 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
1000 <TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#EEEED4">
1001 <TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
1002 <P>
1003 All that is necessary is to copy <B><TT>libxmms-flac.so</TT></B> to the directory where XMMS looks for input plugins (usually <B><TT>/usr/lib/xmms/Input</TT></B>). There is nothing else to configure. Make sure to restart XMMS before trying to play any <TT>.flac</TT> files.
1004 </P>
1005 </FONT>
1006 </TD></TR>
1007 </TABLE>
1008 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
1009</TD></TR>
1010</TABLE>
1011
1012
1013<TABLE WIDTH="100%" CELLPADDING="5" CELLSPACING="5" BORDER="0">
1014<TR><TD>
1015 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
1016 <TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#D3D4C5">
1017 <TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
1018 <A NAME="winamp2_plugin"><B><FONT SIZE="+2">winamp2 plugin</FONT></B>
1019 </FONT></TD></TR>
1020 </TABLE>
1021 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
1022 <TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#EEEED4">
1023 <TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
1024 <P>
Josh Coalson0e33f032004-07-07 19:10:15 +00001025 The Winamp plugin should work for both Winamp2 and Winamp5. If you are using Winamp 2.x, all that is necessary is to copy <B><TT>in_flac.dll</TT></B> to the <B><TT>Plugins/</TT></B> directory of your Winamp installation. There is nothing else to configure. Make sure to restart Winamp before trying to play any <TT>.flac</TT> files.
Josh Coalson5e5fc012002-07-16 16:09:53 +00001026 </P>
1027 </FONT>
1028 </TD></TR>
1029 </TABLE>
1030 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
1031</TD></TR>
1032</TABLE>
1033
1034
1035<TABLE WIDTH="100%" CELLPADDING="5" CELLSPACING="5" BORDER="0">
1036<TR><TD>
1037 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
1038 <TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#D3D4C5">
1039 <TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
Josh Coalson5e5fc012002-07-16 16:09:53 +00001040 <A NAME="bugs"><B><FONT SIZE="+2">known bugs</FONT></B>
1041 </FONT></TD></TR>
1042 </TABLE>
1043 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
1044 <TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#EEEED4">
1045 <TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
1046 <P>
1047 Bug tracking is done on the Sourceforge project page <A HREF="http://sourceforge.net/bugs/?group_id=13478">here</A>. If you submit a bug, make sure and provide an email contact or use the Monitor feature.
1048 </P>
1049 <P>
Josh Coalson3d1da672003-01-16 07:22:33 +00001050 The following are major known bugs in the current (1.1.0) release:
Josh Coalson5e5fc012002-07-16 16:09:53 +00001051 </P>
1052 <P>
1053 <UL>
1054 <LI>
Josh Coalson473eaf32003-01-25 06:04:14 +00001055 If you change the FLAC configuration options in the XMMS plugin while a FLAC file is playing, it can cause a crash or other bad things to happen.
Josh Coalson3d1da672003-01-16 07:22:33 +00001056 </LI>
1057 </UL>
1058 </P>
1059 <P>
Josh Coalson129ef7b2004-09-08 01:12:01 +00001060 The following are major known bugs in the 1.0.4 release:
Josh Coalson3d1da672003-01-16 07:22:33 +00001061 </P>
1062 <P>
1063 <UL>
1064 <LI>
1065 All decoders prior to and including 1.0.4 have a bug that prevents them from skipping unknown metadata blocks properly. A FLAC file created by flac 1.1.0 containing a CUESHEET metadata block will not decode in 1.0.x decoders.
1066 </LI>
1067 <LI>
Josh Coalson1ce20b62002-10-23 22:18:37 +00001068 <B><TT>metaflac</TT></B> has a bug where, if --import-vc-from is used on a FLAC file that has no Vorbis comment block, the FLAC file can be corrupted. All FLAC files generated by 1.0.4 have a Vorbis comment block added automatically but files from 1.0.3 and before do not. This is fixed in CVS.
1069 </LI>
1070 <LI>
1071 There is an odd bug in <B><TT>metaflac</TT></B> such that you must always use the <TT>--dont-use-padding</TT> option with <TT>--add-padding</TT> or the padding block won't be written. This is fixed in CVS.
Josh Coalson5e5fc012002-07-16 16:09:53 +00001072 </LI>
1073 </UL>
1074 </P>
1075 </FONT>
1076 </TD></TR>
1077 </TABLE>
1078 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
1079</TD></TR>
1080</TABLE>
1081
1082
1083<TABLE WIDTH="100%" CELLPADDING="5" CELLSPACING="5" BORDER="0">
1084<TR><TD>
1085 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
1086 <TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#D3D4C5">
1087 <TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
1088 <A NAME="monkey"><B><FONT SIZE="+2">monkey</FONT></B>
1089 </FONT></TD></TR>
1090 </TABLE>
1091 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
1092 <TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#EEEED4">
1093 <TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
1094 <P>
1095 Monkey's Audio comes with a nice GUI that many people are familiar with. It supports some external encoders, but not FLAC. However, the FLAC Windows distribution comes with a utility that allows you to replace one the of the supported lossless external codecs with FLAC. Here's how:
1096 <UL>
1097 <LI>Copy <B><TT>flac.exe</TT></B> and <B><TT>flac_ren.exe</TT></B> to the <B><TT>External/</TT></B> directory of the Monkey's Audio installation.</LI>
1098 <LI>
1099 Choose a supported encoder to replace:
1100 <UL>
1101 <LI>Shorten - copy <B><TT>flac_mac.exe</TT></B> on top of <B><TT>External/shortn32.exe</TT></B></LI>
1102 <LI>WavPack - copy <B><TT>flac_mac.exe</TT></B> on top of both <B><TT>External/wavpack.exe</TT></B> and <B><TT>External/wvunpack.exe</TT></B></LI>
1103 <LI>RKAU - copy <B><TT>flac_mac.exe</TT></B> on top of <B><TT>External/rkau.exe</TT></B></LI>
1104 </UL>
1105 If you choose WavPack you will also be able to use the WavPack Configuration menu to add flac options.
1106 </LI>
1107 <LI>Now you can encode FLAC files as if you were using the replaced encoder. The renamed <B><TT>flac_mac.exe</TT></B> utility will call <B><TT>flac.exe</TT></B> and afterwards, <B><TT>flac_ren.exe</TT></B> will rename the resulting file to have the .flac extension.</LI>
1108 </UL>
1109 </P>
1110 <P>
1111 Other front-ends may be wedged in the same way; if you have one in mind, post it to the <A HREF="http://lists.sourceforge.net/lists/listinfo/flac-dev">flac-dev</A> mailing list.
1112 </P>
1113 </FONT>
1114 </TD></TR>
1115 </TABLE>
1116 <TABLE WIDTH="100%" CELLPADDING="0" CELLSPACING="0" BORDER="0"><TR BGCOLOR="#000000"><TD><IMG SRC="images/1x1.gif" WIDTH="1" HEIGHT="1" ALT=""></TD></TR></TABLE>
1117</TD></TR>
1118</TABLE>
1119
1120
1121</CENTER>
1122
Josh Coalson95643902004-01-17 04:14:43 +00001123<P>&nbsp;Copyright (c) 2000,2001,2002,2003,2004 Josh Coalson</P>
Josh Coalson5e5fc012002-07-16 16:09:53 +00001124
1125</BODY>
1126</HTML>