blob: 48e725b53fa979f12f0e2f310bcc5bbd6f128597 [file] [log] [blame]
Josh Coalson950e3ca2005-02-09 03:37:59 +00001<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Josh Coalson0395dac2006-04-25 06:59:33 +00002<!-- Copyright (c) 2000,2001,2002,2003,2004,2005,2006 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 -->
Josh Coalson950e3ca2005-02-09 03:37:59 +00008<html>
9<head>
10 <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
11 <meta name="author" content="Josh Coalson" />
12 <meta name="description" content="A free, open source codec for lossless audio compression and decompression" />
13 <meta name="keywords" content="free,lossless,audio,codec,encoder,decoder,compression,compressor,archival,archive,archiving,backup,music" />
14 <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
15 <link rel="stylesheet" type="text/css" href="flac.css" />
16 <title>FLAC - documentation</title>
17</head>
Josh Coalson5e5fc012002-07-16 16:09:53 +000018
Josh Coalson950e3ca2005-02-09 03:37:59 +000019<body>
Josh Coalson5e5fc012002-07-16 16:09:53 +000020
Josh Coalson950e3ca2005-02-09 03:37:59 +000021<div class="logo">
22 <a href="http://flac.sourceforge.net/"><img src="images/logo130.gif" alt="FLAC Logo" align="middle" border="0" hspace="0" /></a>
23</div>
Josh Coalson5e5fc012002-07-16 16:09:53 +000024
Josh Coalson950e3ca2005-02-09 03:37:59 +000025<div class="above_nav"></div>
Josh Coalson5e5fc012002-07-16 16:09:53 +000026
Josh Coalson950e3ca2005-02-09 03:37:59 +000027<div class="navbar">
28 &nbsp;<a href="index.html">home</a>&nbsp;&nbsp;|
29 &nbsp;<a href="faq.html">faq</a>&nbsp;&nbsp;|
30 &nbsp;<a href="news.html">news</a>&nbsp;&nbsp;|
31 &nbsp;<a href="download.html">download</a>&nbsp;&nbsp;|
32 &nbsp;<a href="features.html">features</a>&nbsp;&nbsp;|
33 &nbsp;<a href="goals.html">goals</a>&nbsp;&nbsp;|
34 &nbsp;<a href="format.html">format</a>&nbsp;&nbsp;|
35 &nbsp;<a href="id.html">id</a>&nbsp;&nbsp;|
36 &nbsp;<a href="comparison.html">comparison</a>&nbsp;&nbsp;|
37 &nbsp;documentation&nbsp;&nbsp;|
38 &nbsp;<a href="changelog.html">changelog</a>&nbsp;&nbsp;|
39 &nbsp;<a href="links.html">links</a>&nbsp;&nbsp;|
40 &nbsp;<a href="developers.html">developers</a>&nbsp;
41</div>
Josh Coalson5e5fc012002-07-16 16:09:53 +000042
Josh Coalson950e3ca2005-02-09 03:37:59 +000043<div class="langbar">
44 &nbsp;english&nbsp;&nbsp;|
45 &nbsp;<a href="ru/documentation.html">russian</a>&nbsp;
46</div>
Josh Coalson5e5fc012002-07-16 16:09:53 +000047
Josh Coalson950e3ca2005-02-09 03:37:59 +000048<div class="below_nav"></div>
Josh Coalson5e5fc012002-07-16 16:09:53 +000049
Josh Coalson950e3ca2005-02-09 03:37:59 +000050<div class="box">
51 <div class="box_title">
52 documentation
53 </div>
54 <div class="box_header"></div>
55 <div class="box_body">
Josh Coalson5e5fc012002-07-16 16:09:53 +000056 This page is broken up into the following sections:
Josh Coalson950e3ca2005-02-09 03:37:59 +000057 <ul>
58 <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>
59 <li><a href="#flac">flac</a> - the usage of the command-line file encoder/decoder <span class="commandname">flac</span>.</li>
60 <li><a href="#metaflac">metaflac</a> - the usage of the command-line FLAC metadata editor <span class="commandname">metaflac</span>.</li>
61 <li><a href="#plugins">plugins</a> - documentation for the various input plugins.</li>
62 <li><a href="api/index.html">libFLAC and libFLAC++ APIs</a> - for developers who want to add FLAC support to their programs.</li>
63 <li><a href="#bugs">bugs</a> - known bugs.</li>
64 <li><a href="#monkey">How to add FLAC support to the Monkey's Audio GUI</a></li>
65 </ul>
Josh Coalson5e5fc012002-07-16 16:09:53 +000066 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.
Josh Coalson950e3ca2005-02-09 03:37:59 +000067 </div>
68 <div class="box_footer"></div>
69</div>
Josh Coalson5e5fc012002-07-16 16:09:53 +000070
Josh Coalson950e3ca2005-02-09 03:37:59 +000071<br />
Josh Coalson5e5fc012002-07-16 16:09:53 +000072
Josh Coalson950e3ca2005-02-09 03:37:59 +000073<div class="box">
74 <div class="box_title">
75 <a name="format">format</a>
76 </div>
77 <div class="box_header"></div>
78 <div class="box_body">
79 <span class="commandname">flac</span> 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>.
80 <br /><br />
Josh Coalson5e5fc012002-07-16 16:09:53 +000081 The basic structure of a FLAC stream is:
Josh Coalson950e3ca2005-02-09 03:37:59 +000082 <ul>
83 <li>The four byte string "<span class="code">fLaC</span>"</li>
84 <li>The <a href="format.html#def_STREAMINFO"><span class="code">STREAMINFO</span></a> metadata block</li>
85 <li>Zero or more other metadata blocks</li>
86 <li>One or more audio frames</li>
87 </ul>
Josh Coalson5e5fc012002-07-16 16:09:53 +000088 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.
Josh Coalson950e3ca2005-02-09 03:37:59 +000089 <br /><br />
90 <b>METADATA</b>
91 <br /><br />
92 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 <span class="code">STREAMINFO</span> 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 <span class="code">STREAMINFO</span> block is the MD5 signature of the <i>unencoded</i> audio data. This is useful for checking an entire stream for transmission errors.
93 <br /><br />
94 Other blocks allow for padding, seek tables, tags, cuesheets, and application-specific data. You can see <span class="commandname">flac</span> options below for adding <span class="code">PADDING</span> 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.
95 <br /><br />
96 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 <span class="code">PADDING</span> block of the correct size when encoding, and overwrite the padding block with your <span class="code">APPLICATION</span> 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.
97 <br /><br />
98 <b>AUDIO DATA</b>
99 <br /><br />
Josh Coalson5e5fc012002-07-16 16:09:53 +0000100 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.
Josh Coalson950e3ca2005-02-09 03:37:59 +0000101 <br /><br />
102 <b>BLOCKING</b>
103 <br /><br />
104 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. <span class="commandname">flac</span> 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.
105 <br /><br />
106 <b>INTER-CHANNEL DECORRELATION</b>
107 <br /><br />
108 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. <span class="commandname">flac</span> has two options for this: <span class="argument">-m</span> always compresses both the left-right and mid-side versions of the block and takes the smallest frame, and <span class="argument">-M</span>, which adaptively switches between left-right and mid-side.
109 <br /><br />
110 <b>MODELING</b>
111 <br /><br />
112 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.
113 <br /><br />
114 First, fixed polynomial prediction (specified with <span class="argument">-l 0</span>) 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 <span class="argument">-e</span> to overcome this, which is significantly slower.
115 <br /><br />
Josh Coalson5e5fc012002-07-16 16:09:53 +0000116 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.
Josh Coalson950e3ca2005-02-09 03:37:59 +0000117 <br /><br />
118 <b>RESIDUAL CODING</b>
119 <br /><br />
Josh Coalson5e5fc012002-07-16 16:09:53 +0000120 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.
Josh Coalson950e3ca2005-02-09 03:37:59 +0000121 <br /><br />
122 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. <span class="commandname">flac</span> allows you to specify how the partitioning is done with the <span class="argument">-r</span> option. The residual can be broken into 2^<i>n</i> partitions, by using the option <span class="argument">-r n,n</span>. 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 <span class="argument">-r m,n</span>. 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.
123 <br /><br />
124 <b>FRAMING</b>
125 <br /><br />
Josh Coalson5e5fc012002-07-16 16:09:53 +0000126 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.
Josh Coalson950e3ca2005-02-09 03:37:59 +0000127 <br /><br />
128 <b>MISCELLANEOUS</b>
129 <br /><br />
130 As a convenience, 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 and their use is discouraged.
131 <br /><br />
132 <span class="commandname">flac</span> has a verify option <span class="argument">-V</span> 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 <span class="commandname">flac</span> will stop with an error.
133 </div>
134 <div class="box_footer"></div>
135</div>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000136
Josh Coalson950e3ca2005-02-09 03:37:59 +0000137<br />
Josh Coalson5e5fc012002-07-16 16:09:53 +0000138
Josh Coalson950e3ca2005-02-09 03:37:59 +0000139<div class="box">
140 <div class="box_title">
141 <a name="flac">flac</a>
142 </div>
143 <div class="box_header"></div>
144 <div class="box_body">
145 <span class="commandname">flac</span> 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. <span class="commandname">flac</span> 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.
146 <br /><br />
147 <span class="commandname">flac</span> 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, <span class="commandname">flac</span> 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).
148 <br /><br />
149 Before going into the full command-line description, a few other things help to sort it out: 1) <span class="commandname">flac</span> encodes by default, so you must use <b>-d</b> to decode; 2) the options <span class="argument">-0</span> .. <span class="argument">-8</span> (or <span class="argument">--fast</span> and <span class="argument">--best</span>) 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) <span class="commandname">flac</span> behaves similarly to gzip in the way it handles input and output files.
150 <br /><br />
151 <span class="commandname">flac</span> will be invoked one of four ways, depending on whether you are encoding, decoding, testing, or analyzing:
152 <ul>
153 <li>
154 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 [...]]
155 </li>
156 <li>
157 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 [...]]
158 </li>
159 <li>
160 Testing: flac -t [<i><a href="#general_options">&lt;general-options&gt;</a></i>] [FLACfile [...]]
161 </li>
162 <li>
163 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 [...]]
164 </li>
165 </ul>
166 In any case, if no <span class="argument">inputfile</span> is specified, stdin is assumed. If only one inputfile is specified, it may be "-" for stdin. When stdin is used as input, <span class="commandname">flac</span> will write to stdout. Otherwise <span class="commandname">flac</span> 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.
167 <br /><br />
Josh Coalson5e5fc012002-07-16 16:09:53 +0000168 If you are encoding/decoding from stdin to a file, you should use the -o option like so:
Josh Coalson950e3ca2005-02-09 03:37:59 +0000169 <ul>
170 <li>
171 flac [options] -o outputfile
172 </li>
173 <li>
174 flac -d [options] -o outputfile
175 </li>
176 </ul>
177 which are better than:
178 <ul>
179 <li>
180 flac [options] &gt; outputfile
181 </li>
182 <li>
183 flac -d [options] &gt; outputfile
184 </li>
185 </ul>
186 since the former allows flac to seek backwards to write the <span class="code">STREAMINFO</span> or RIFF WAVE header contents when necessary.
187 <br /><br />
188 Also, you can force output data to go to stdout using <span class="argument">-c</span>.
189 <br /><br />
190 To encode or decode files that start with a dash, use <span class="argument">--</span> to signal the end of options, to keep the filenames themselves from being treated as options:
191 <ul>
192 <li>
193 <span class="code">flac -V -- -01-filename.wav</span>
194 </li>
195 </ul>
196 The encoding options affect the compression ratio and encoding speed. The format options are used to tell <span class="commandname">flac</span> 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.
197 <br /><br />
198 In test mode, <span class="commandname">flac</span> 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.
199 <br /><br />
Josh Coalson5e5fc012002-07-16 16:09:53 +0000200
Josh Coalson950e3ca2005-02-09 03:37:59 +0000201 <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#EEEED4"><tr><td>
202 <table width="100%" border="1" bgcolor="#EEEED4">
203 <tr>
204 <td colspan="2" bgcolor="#D3D4C5">
205 <a name="general_options"><font size="+1"><b>General Options</b></font></a>
206 </td>
207 </tr>
208 <tr>
209 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
210 <a name="flac_options_version" />
211 <span class="argument">-v</span>, <span class="argument">--version</span>
212 </td>
213 <td>
214 Show the <span class="commandname">flac</span> version number.
215 </td>
216 </tr>
217 <tr>
218 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
219 <a name="flac_options_help" />
220 <span class="argument">-h</span>, <span class="argument">--help</span>
221 </td>
222 <td>
223 Show basic usage and a list of all options. Running <span class="commandname">flac</span> without arguments shows the short help screen by default.
224 </td>
225 </tr>
226 <tr>
227 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
228 <a name="flac_options_explain" />
229 <span class="argument">-H</span>, <span class="argument">--explain</span>
230 </td>
231 <td>
232 Show detailed explanation of usage and all options. Running <span class="commandname">flac</span> without arguments shows the short help screen by default.
233 </td>
234 </tr>
235 <tr>
236 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
237 <a name="flac_options_decode" />
238 <span class="argument">-d</span>, <span class="argument">--decode</span>
239 </td>
240 <td>
Josh Coalsona3dc20b2005-02-11 21:48:28 +0000241 Decode (<span class="commandname">flac</span> encodes by default). <span class="commandname">flac</span> will exit with an exit code of <span class="argument">1</span> (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 <span class="argument">0</span>.
Josh Coalson950e3ca2005-02-09 03:37:59 +0000242 </td>
243 </tr>
244 <tr>
245 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
246 <a name="flac_options_test" />
247 <span class="argument">-t</span>, <span class="argument">--test</span>
248 </td>
249 <td>
250 Test (same as <span class="argument">-d</span> except no decoded file is written). The exit codes are the same as in decode mode.
251 </td>
252 </tr>
253 <tr>
254 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
255 <a name="flac_options_analyze" />
256 <span class="argument">-a</span>, <span class="argument">--analyze</span>
257 </td>
258 <td>
259 Analyze (same as <span class="argument">-d</span> 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.
260 </td>
261 </tr>
262 <tr>
263 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
264 <a name="flac_options_stdout" />
265 <span class="argument">-c</span>, <span class="argument">--stdout</span>
266 </td>
267 <td>
268 Write output to stdout.
269 </td>
270 </tr>
271 <tr>
272 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
273 <a name="flac_options_silent" />
274 <span class="argument">-s</span>, <span class="argument">--silent</span>
275 </td>
276 <td>
277 Silent: do not show encoding/decoding statistics.
278 </td>
279 </tr>
280 <tr>
281 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
282 <a name="flac_options_totally_silent" />
283 <span class="argument">--totally-silent</span>
284 </td>
285 <td>
286 Do not print anything of any kind, including warnings or errors. The exit code will be the only way to determine successful completion.
287 </td>
288 </tr>
289 <tr>
290 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
291 <a name="flac_options_force" />
292 <span class="argument">-f</span>, <span class="argument">--force</span>
293 </td>
294 <td>
295 Force overwriting of output files. By default, <span class="commandname">flac</span> warns that the output file already exists and continues to the next file.
296 </td>
297 </tr>
298 <tr>
299 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
300 <a name="flac_options_output_name" />
301 <span class="argument">-o filename</span>,<br /><span class="argument">--output-name=filename</span>
302 </td>
303 <td>
304 Force the output file name (usually <span class="commandname">flac</span> just changes the extension). May only be used when encoding a single file. May not be used in conjunction with <a href="#flac_options_output_prefix"><span class="argument">--output-prefix</span></a>.
305 </td>
306 </tr>
307 <tr>
308 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
309 <a name="flac_options_output_prefix" />
310 <span class="argument">--output-prefix=string</span>
311 </td>
312 <td>
313 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 '<span class="argument">/</span>' slash.
314 </td>
315 </tr>
316 <tr>
317 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
318 <a name="flac_options_delete_input_file" />
319 <span class="argument">--delete-input-file</span>
320 </td>
321 <td>
322 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.
323 </td>
324 </tr>
325 <tr>
326 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
327 <a name="flac_options_skip" />
328 <span class="argument">--skip={#|mm:ss.ss}</span>
329 </td>
330 <td>
331 Skip over the first # of samples of the input. This works for both encoding and decoding, but not testing. The alternative form <span class="argument">mm:ss.ss</span> can be used to specify minutes, seconds, and fractions of a second.<br /><br />
332 Examples:<br /><br />
333 <span class="argument">--skip=123</span> : skip the first 123 samples of the input<br />
334 <span class="argument">--skip=1:23.45</span> : skip the first 1 minute and 23.45 seconds of the input
335 </td>
336 </tr>
337 <tr>
338 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
339 <a name="flac_options_until" />
340 <span class="argument">--until={#|[+|-]mm:ss.ss}</span>
341 </td>
342 <td>
343 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 <span class="argument">mm:ss.ss</span> can be used to specify minutes, seconds, and fractions of a second. If a <span class="argument">+</span> sign is at the beginning, the <span class="argument">--until</span> point is relative to the <span class="argument">--skip</span> point. If a <span class="argument">-</span> sign is at the beginning, the <span class="argument">--until</span> point is relative to end of the audio.<br /><br />
344 Examples:<br /><br />
345 <span class="argument">--until=123</span> : decode only the first 123 samples of the input (samples 0-122, stopping at 123)<br />
346 <span class="argument">--until=1:23.45</span> : decode only the first 1 minute and 23.45 seconds of the input<br />
347 <span class="argument">--skip=1:00 --until=+1:23.45</span> : decode 1:00.00 to 2:23.45<br />
348 <span class="argument">--until=-1:23.45</span> : decode everything except the last 1 minute and 23.45 seconds<br />
349 <span class="argument">--until=-0:00</span> : decode until the end of the input (the same as not specifying <span class="argument">--until</span>)
350 </td>
351 </tr>
352 <tr>
353 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
354 <a name="flac_options_ogg" />
355 <span class="argument">--ogg</span>
356 </td>
357 <td>
358 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 <span class="commandname">flac</span>.<br /><br />
359 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'.<br /><br />
360 <b>NOTE:</b> Ogg FLAC files created prior to <span class="commandname">flac</span> 1.1.1 used an ad-hoc mapping and do not support seeking. They should be decoded and re-encoded with <span class="commandname">flac</span> 1.1.1 or later.
361 </td>
362 </tr>
363 <tr>
364 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
365 <a name="flac_options_serial_number" />
366 <span class="argument">--serial-number=#</span>
367 </td>
368 <td>
369 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, <span class="commandname">flac</span> uses a random number for the first stream, then increments it for each additional stream. When decoding and no number is given, <span class="commandname">flac</span> uses the serial number of the first page.
370 </td>
371 </tr>
372 </table>
373 </td></tr></table>
Josh Coalson5e5fc012002-07-16 16:09:53 +0000374
Josh Coalson950e3ca2005-02-09 03:37:59 +0000375 <br />
376
377 <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#EEEED4"><tr><td>
378 <table width="100%" border="1" bgcolor="#EEEED4">
379 <tr>
380 <td colspan="2" bgcolor="#D3D4C5">
381 <a name="analysis_options"><font size="+1"><b>Analysis Options</b></font></a>
382 </td>
383 </tr>
384 <tr>
385 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
386 <a name="flac_options_residual_text" />
387 <span class="argument">--residual-text</span>
388 </td>
389 <td>
390 Includes the residual signal in the analysis file. This will make the file <b>very</b> big, much larger than even the decoded file.
391 </td>
392 </tr>
393 <tr>
394 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
395 <a name="flac_options_residual_gnuplot" />
396 <span class="argument">--residual-gnuplot</span>
397 </td>
398 <td>
399 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.
400 </td>
401 </tr>
402 </table>
403 </td></tr></table>
404
405 <br />
406
407 <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#EEEED4"><tr><td>
408 <table width="100%" border="1" bgcolor="#EEEED4">
409 <tr>
410 <td colspan="2" bgcolor="#D3D4C5">
411 <a name="decoding_options"><font size="+1"><b>Decoding Options</b></font></a>
412 </td>
413 </tr>
414 <tr>
415 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
416 <a name="flac_options_cue" />
417 <span class="argument">--cue=[#.#][-[#.#]]</span>
418 </td>
419 <td>
420 Set the beginning and ending cuepoints to decode. The optional first <span class="argument">#.#</span> is the track and index point at which decoding will start; the default is the beginning of the stream. The optional second <span class="argument">#.#</span> is the track and index point at which decoding will end; the default is the end of the stream. If the cuepoint 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.<br /><br />
421 Examples:<br /><br />
422 <span class="argument">--cue=-</span> : decode the entire stream<br />
423 <span class="argument">--cue=4.1</span> : decode from track 4, index 1 to the end of the stream<br />
424 <span class="argument">--cue=4.1-</span> : decode from track 4, index 1 to the end of the stream<br />
425 <span class="argument">--cue=-4.1</span> : decode from the beginning of the stream up to, but not including, track 4, index 1<br />
Josh Coalsonea73d722006-04-28 00:15:01 +0000426 <span class="argument">--cue=2.1-2.4</span> : decode from track 2, index 1, up to, but not including, track 2, index 4<br />
427 <span class="argument">--cue=9.1-10.1</span> : decode from track 9 the way it would be played on a CD player; this works even if the CD has no 10th track.
Josh Coalson950e3ca2005-02-09 03:37:59 +0000428 </td>
429 </tr>
430 <tr>
431 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
432 <a name="flac_options_decode_through_errors" />
433 <span class="argument">-F</span>,<br /><span class="argument">--decode-through-errors</span>
434 </td>
435 <td>
436 By default <span class="commandname">flac</span> stops decoding with an error and removes the partially decoded file if it encounters a bitstream error. With <span class="argument">-F</span>, errors are still printed but <span class="commandname">flac</span> will continue decoding to completion. Note that errors may cause the decoded audio to be missing some samples or have silent sections.
437 </td>
438 </tr>
439 <!-- @@@ undocumented, also not in the man page yet
440 <tr>
441 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
442 <a name="flac_options_apply_replaygain_which_is_not_lossless" />
443 <span class="argument">-@@@-apply-replaygain-which-is-not-lossless[=&lt;specification&gt;]</span>
444 </td>
445 <td>
446 Applies ReplayGain values while decoding.
447 <br /><br />
448 <b>WARNING: THIS IS NOT LOSSLESS. DECODED AUDIO WILL NOT BE IDENTICAL TO THE ORIGINAL WITH THIS OPTION</b>.
449 <br /><br />
450 The equals sign and &lt;specification&gt; is optional. If omitted, the default is <span class="argument">0aLn1</span>.
451 <br /><br />
452 The <span class="argument">&lt;specification&gt;</span> is a shorthand notation for describing how to apply ReplayGain. All components are optional but order is important. '<span class="argument">[]</span>' means 'optional'. '<span class="argument">|</span>' means 'or'. '<span class="argument">{}</span>' means required. The format is:<br /><br />
453 &nbsp;&nbsp;<span class="argument">[&lt;preamp&gt;][a|t][l|L][n{0|1|2|3}]</span>
454 <ul>
455 <li>
456 <span class="argument">&lt;preamp&gt;</span><br />
457 &nbsp;&nbsp;A floating point number in dB. This is added to the existing gain value.
458 </li>
459 <li>
460 <span class="argument">a|t</span><br />
Josh Coalson95e39a82005-09-01 01:01:08 +0000461 &nbsp;&nbsp;Specify '<span class="argument">a</span>' to use the album gain, or '<span class="argument">t</span>' to use the track gain. If tags for the preferred kind (album/track) do not exist but tags for the other (track/album) do, those will be used instead.
Josh Coalson950e3ca2005-02-09 03:37:59 +0000462 </li>
463 <li>
464 <span class="argument">l|L</span><br />
465 &nbsp;&nbsp;Specify '<span class="argument">l</span>' to peak-limit the output, so that the ReplayGain peak value is full-scale. Specify '<span class="argument">L</span>' to use a 6dB hard limiter that kicks in when the signal approaches full-scale.
466 </li>
467 <li>
468 <span class="argument">n{0|1|2|3}</span><br />
469 &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. <span class="argument">0</span> means no noise shaping, <span class="argument">1</span> means 'low', <span class="argument">2</span> means 'medium', <span class="argument">3</span> means 'high'.
470 </li>
471 </ul>
472 For example, the default of <span class="argument">0aLn1</span> means 0dB preamp, use album gain, 6dB hard limit, low noise shaping.
473 <br /><br />
474 <span class="argument">-@@@-apply-replaygain-which-is-not-lossless=3</span> means 3dB preamp, use album gain, no limiting, no noise shaping.
475 <br /><br />
476 <span class="commandname">flac</span> 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.
477 </td>
478 </tr>
479 -->
480 </table>
481 </td></tr></table>
482
483 <br />
484
485 <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#EEEED4"><tr><td>
486 <table width="100%" border="1" bgcolor="#EEEED4">
487 <tr>
488 <td colspan="2" bgcolor="#D3D4C5">
489 <a name="encoding_options"><font size="+1"><b>Encoding Options</b></font></a>
490 </td>
491 </tr>
492 <tr>
493 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
494 <a name="flac_options_verify" />
495 <span class="argument">-V</span>, <span class="argument">--verify</span>
496 </td>
497 <td>
498 Verify the encoding process. With this option, <span class="commandname">flac</span> 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. <span class="argument">-V</span> increases the total encoding time but is guaranteed to catch any unforseen bug in the encoding process.
499 </td>
500 </tr>
501 <tr>
502 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
503 <a name="flac_options_lax" />
504 <span class="argument">--lax</span>
505 </td>
506 <td>
507 Allow encoder to generate non-<a href="format.html#subset">Subset</a> files. The resulting FLAC file may not be streamable or might have trouble being played in all players (especially hardware devices), so you should only use this option in combination with custom encoding options meant for archival.
508 </td>
509 </tr>
510 <tr>
511 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
512 <a name="flac_options_replay_gain" />
513 <span class="argument">--replay-gain</span>
514 </td>
515 <td>
Josh Coalson83fa59c2005-08-31 01:00:53 +0000516 Calculate <a href="http://www.replaygain.org/">ReplayGain</a> values and store them as 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 <span class="code">PADDING</span> block as the exact size of the tags is not known until all files are processed.<br /><br />
Josh Coalson950e3ca2005-02-09 03:37:59 +0000517 Note that this option cannot be used when encoding to standard output (stdout).
518 </td>
519 </tr>
520 <tr>
521 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
522 <a name="flac_options_cuesheet" />
523 <span class="argument">--cuesheet=FILENAME</span>
524 </td>
525 <td>
526 Import the given cuesheet file and store it in a <a href="format.html#def_CUESHEET"><span class="code">CUESHEET</span></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"><span class="code">SEEKTABLE</span></a> unless <span class="argument">--no-cued-seekpoints</span> is specified.<br /><br />
527 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.
528 </td>
529 </tr>
530 <tr>
531 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
532 <a name="flac_options_sector_align" />
533 <span class="argument">--sector-align</span>
534 </td>
535 <td>
Josh Coalson4731c752005-08-27 01:58:19 +0000536 Align encoding of multiple CD format files on sector boundaries. This option is only allowed when encoding files all of which have a 44.1kHz sample rate and 2 channels. With <span class="argument">--sector-align</span>, 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 file to the next stream. The last stream will be padded to alignment with zeroes.<br /><br />
Josh Coalson950e3ca2005-02-09 03:37:59 +0000537 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). <span class="commandname">flac</span> can only align a set of files given in one invocation of <span class="commandname">flac</span>.<br /><br />
538 <b>WARNING:</b> The ordering of files is important! If you give a command like '<span class="code">flac --sector-align *.wav</span>' the shell may not expand the wildcard to the order you expect. To be safe you should '<span class="code">echo *.wav</span>' first to confirm the order, or be explicit like '<span class="code">flac --sector-align 8.wav 9.wav 10.wav</span>'.
539 </td>
540 </tr>
541 <tr>
542 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
543 <a name="flac_options_seekpoint" />
544 <span class="argument">-S {#|X|#x|#s}</span>,<br /><span class="argument">--seekpoint={#|X|#x|#s}</span>
545 </td>
546 <td>
547 Include a point or points in a <span class="code">SEEKTABLE</span>:<br />
548 <ul>
549 <li>
550 <span class="argument">#&nbsp;</span> : a specific sample number for a seek point
551 </li>
552 <li>
553 <span class="argument">X&nbsp;</span> : a placeholder point (always goes at the end of the <span class="code">SEEKTABLE</span>)
554 </li>
555 <li>
556 <span class="argument">#x</span> : # evenly spaced seekpoints, the first being at sample 0
557 </li>
558 <li>
559 <span class="argument">#s</span> : a seekpoint every # seconds; # does not have to be a whole number, it can be, for example, <span class="argument">9.5</span>, meaning a seekpoint every 9.5 seconds
560 </li>
561 </ul>
562 You may use many -S options; the resulting <span class="code">SEEKTABLE</span> will be the unique-ified union of all such values.<br />
563 With no -S options, flac defaults to '-S 10s'. Use --no-seektable for no <span class="code">SEEKTABLE</span>.<br />
564 <b>NOTE:</b> -S #x and -S #s will not work if the encoder can't determine the input size before starting.<br />
565 <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 />
566 </td>
567 </tr>
568 <tr>
569 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
570 <a name="flac_options_padding" />
571 <span class="argument">-P #</span>, <span class="argument">--padding=#</span>
572 </td>
573 <td>
574 Tell the encoder to write a <span class="code">PADDING</span> metadata block of the given length (in bytes) after the <span class="code">STREAMINFO</span> block. This is useful if you plan to tag the file later with an <span class="code">APPLICATION</span> block; instead of having to rewrite the entire file later just to insert your block, you can write directly over the <span class="code">PADDING</span> block. Note that the total length of the <span class="code">PADDING</span> block will be 4 bytes longer than the length given because of the 4 metadata block header bytes. You can force no <span class="code">PADDING</span> block at all to be written with <span class="argument">--no-padding</span>. The encoder writes a <span class="code">PADDING</span> block of 4096 bytes by default.
575 </td>
576 </tr>
577 <tr>
578 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
579 <a name="flac_options_tag" />
580 <span class="argument">-T FIELD=VALUE</span>,<br /><span class="argument">--tag=FIELD=VALUE</span>
581 </td>
582 <td>
583 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.
584 </td>
585 </tr>
586 <tr>
587 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
Josh Coalson26c82352006-05-18 07:57:16 +0000588 <a name="flac_options_tag_from_file" />
589 <span class="argument">--tag-from-file=FIELD=FILENAME</span>
590 </td>
591 <td>
592 Like <a href="#flac_options_tag"><span class="argument">--tag</span></a>, except FILENAME is a file whose contents will be read verbatim to set the tag value. The contents will be converted to UTF-8 from the local charset. This can be used to store a cuesheet in a tag (e.g. <span class="argument">--tag-from-file="CUESHEET=image.cue"</span>). Do not try to store binary data in tag fields! Use APPLICATION blocks for that.
593 </td>
594 </tr>
595 <tr>
596 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
Josh Coalson950e3ca2005-02-09 03:37:59 +0000597 <a name="flac_options_blocksize" />
598 <span class="argument">-b #</span>, <span class="argument">--blocksize=#</span>
599 </td>
600 <td>
601 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.
602 </td>
603 </tr>
604 <tr>
605 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
606 <a name="flac_options_mid_side" />
607 <span class="argument">-m</span>, <span class="argument">--mid-side</span>
608 </td>
609 <td>
610 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.
611 </td>
612 </tr>
613 <tr>
614 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
615 <a name="flac_options_adaptive_mid_side" />
616 <span class="argument">-M</span>, <span class="argument">--adaptive-mid-side</span>
617 </td>
618 <td>
619 Enable adaptive mid-side coding (only for stereo streams). Like <span class="argument">-m</span> but the encoder adaptively switches between independent and mid-side coding, which is faster but yields less compression than <span class="argument">-m</span> (which does an exhaustive search).
620 </td>
621 </tr>
622 <tr>
623 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
624 <a name="flac_options_levels" />
625 <span class="argument">-0 .. -8</span>
626 </td>
627 <td>
628 Fastest compression .. highest compression. The default is <span class="argument">-5</span>.
629 </td>
630 </tr>
631 <tr>
632 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
633 <a name="flac_options_level_0" />
634 <span class="argument">-0</span>, <span class="argument">--compression-level-0</span>
635 </td>
636 <td>
637 Synonymous with <span class="argument">-l 0 -b 1152 -r 2,2</span>
638 </td>
639 </tr>
640 <tr>
641 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
642 <a name="flac_options_level_1" />
643 <span class="argument">-1</span>, <span class="argument">--compression-level-1</span>
644 </td>
645 <td>
646 Synonymous with <span class="argument">-l 0 -b 1152 -M -r 2,2</span>
647 </td>
648 </tr>
649 <tr>
650 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
651 <a name="flac_options_level_2" />
652 <span class="argument">-2</span>, <span class="argument">--compression-level-2</span>
653 </td>
654 <td>
655 Synonymous with <span class="argument">-l 0 -b 1152 -m -r 3</span>
656 </td>
657 </tr>
658 <tr>
659 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
660 <a name="flac_options_level_3" />
661 <span class="argument">-3</span>, <span class="argument">--compression-level-3</span>
662 </td>
663 <td>
664 Synonymous with <span class="argument">-l 6 -b 4608 -r 3,3</span>
665 </td>
666 </tr>
667 <tr>
668 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
669 <a name="flac_options_level_4" />
670 <span class="argument">-4</span>, <span class="argument">--compression-level-4</span>
671 </td>
672 <td>
673 Synonymous with <span class="argument">-l 8 -b 4608 -M -r 3,3</span>
674 </td>
675 </tr>
676 <tr>
677 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
678 <a name="flac_options_level_5" />
679 <span class="argument">-5</span>, <span class="argument">--compression-level-5</span>
680 </td>
681 <td>
682 Synonymous with <span class="argument">-l 8 -b 4608 -m -r 3,3</span>
683 </td>
684 </tr>
685 <tr>
686 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
687 <a name="flac_options_level_6" />
688 <span class="argument">-6</span>, <span class="argument">--compression-level-6</span>
689 </td>
690 <td>
691 Synonymous with <span class="argument">-l 8 -b 4608 -m -r 4</span>
692 </td>
693 </tr>
694 <tr>
695 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
696 <a name="flac_options_level_7" />
697 <span class="argument">-7</span>, <span class="argument">--compression-level-7</span>
698 </td>
699 <td>
700 Synonymous with <span class="argument">-l 8 -b 4608 -m -e -r 6</span>
701 </td>
702 </tr>
703 <tr>
704 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
705 <a name="flac_options_level_8" />
706 <span class="argument">-8</span>, <span class="argument">--compression-level-8</span>
707 </td>
708 <td>
709 Synonymous with <span class="argument">-l 12 -b 4608 -m -e -r 6</span>
710 </td>
711 </tr>
712 <tr>
713 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
714 <a name="flac_options_fast" />
715 <span class="argument">--fast</span>
716 </td>
717 <td>
718 Fastest compression. Currently synonymous with <span class="argument">-0</span>
719 </td>
720 </tr>
721 <tr>
722 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
723 <a name="flac_options_best" />
724 <span class="argument">--best</span>
725 </td>
726 <td>
727 Highest compression. Currently synonymous with <span class="argument">-8</span>
728 </td>
729 </tr>
730 <tr>
731 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
732 <a name="flac_options_exhaustive_model_search" />
733 <span class="argument">-e</span>,<br /><span class="argument">--exhaustive-model-search</span>
734 </td>
735 <td>
736 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%.
737 </td>
738 </tr>
739 <tr>
740 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
Josh Coalsonea73d722006-04-28 00:15:01 +0000741 <a name="flac_options_apodization" />
742 <span class="argument">-A "function"</span>, <span class="argument">--apodization="function"</span>
743 </td>
744 <td>
745 Window audio data with given the apodization function. The functions are: bartlett, bartlett_hann, blackman, blackman_harris_4term_92db, connes, flattop, gauss(STDDEV), hamming, hann, kaiser_bessel, nuttall, rectangle, triangle, tukey(P), welch.<br />
746 For gauss(STDDEV), STDDEV is the standard deviation (0&lt;STDDEV&lt;=0.5).<br />
747 For tukey(P), P specifies the fraction of the window that is tapered (0&lt;=P&lt;=1; P=0 corresponds to "rectangle" and P=1 corresponds to "hann").<br />
748 More than one -A option (up to 32) may be used. Any function that is specified erroneously is silently dropped. The encoder chooses suitable defaults in the absence of any -A options; any -A option specified replaces the default(s).<br />
749 When more than one function is specified, then for every subframe the encoder will try each of them separately and choose the window that results in the smallest compressed subframe. Multiple functions can greatly increase the encoding time.<br />
750 </td>
751 </tr>
752 <tr>
753 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
Josh Coalson950e3ca2005-02-09 03:37:59 +0000754 <a name="flac_options_max_lpc_order" />
755 <span class="argument">-l #</span>, <span class="argument">--max-lpc-order=#</span>
756 </td>
757 <td>
758 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.
759 </td>
760 </tr>
761 <tr>
762 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
763 <a name="flac_options_qlp_coeff_precision" />
764 <span class="argument">-q #</span>,<br /><span class="argument">--qlp-coeff-precision=#</span>
765 </td>
766 <td>
767 Specifies the precision of the quantized LP coefficients, in bits. The default is <span class="argument">-q 0</span>, 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.
768 </td>
769 </tr>
770 <tr>
771 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
772 <a name="flac_options_qlp_coeff_precision_search" />
773 <span class="argument">-p</span>,<br /><span class="argument">--qlp-coeff-precision-search</span>
774 </td>
775 <td>
776 Do exhaustive LP coefficient quantization optimization. This option overrides any <span class="argument">-q</span> option. It is expensive and typically will only improve the compression a tiny fraction of a percent. <span class="argument">-q</span> has no effect when <span class="argument">-l 0</span> is used.
777 </td>
778 </tr>
779 <tr>
780 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
781 <a name="flac_options_rice_partition_order" />
782 <span class="argument">-r [#,]#</span>,<br /><span class="argument">--rice-partition-order=[#,]#</span>
783 </td>
784 <td>
785 Set the [min,]max residual partition order. The min value defaults to 0 if unspecified.<br /><br />
786 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 <span class="argument">-r 2,2</span> (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 <span class="argument">-r 0,16</span> to force the highest degree of optimization.
787 </td>
788 </tr>
789 </table>
790 </td></tr></table>
791
792 <br />
793
794 <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#EEEED4"><tr><td>
795 <table width="100%" border="1" bgcolor="#EEEED4">
796 <tr>
797 <td colspan="2" bgcolor="#D3D4C5">
798 <a name="format_options"><font size="+1"><b>Format Options</b></font></a>
799 </td>
800 </tr>
801 <tr>
802 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
803 <a name="flac_options_endian" />
804 <span class="argument">--endian={big|little}</span>
805 </td>
806 <td>
807 Specify big-endian or little-endian byte order in the raw file.
808 </td>
809 </tr>
810 <tr>
811 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
812 <a name="flac_options_channels" />
813 <span class="argument">--channels=#</span>
814 </td>
815 <td>
816 Specify the number of channels in the raw file.
817 </td>
818 </tr>
819 <tr>
820 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
821 <a name="flac_options_bps" />
822 <span class="argument">--bps=#</span>
823 </td>
824 <td>
825 Specify the number of bits per sample in the raw file.
826 </td>
827 </tr>
828 <tr>
829 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
830 <a name="flac_options_sample_rate" />
831 <span class="argument">--sample-rate=#</span>
832 </td>
833 <td>
834 Specify the sample rate of the raw file.
835 </td>
836 </tr>
837 <tr>
838 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
839 <a name="flac_options_sign" />
840 <span class="argument">--sign={signed|unsigned}</span>
841 </td>
842 <td>
843 Specify that the samples in the raw file are signed or unsigned (the default is signed).
844 </td>
845 </tr>
846 <tr>
847 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
848 <a name="flac_options_input_size" />
849 <span class="argument">--input-size=#</span>
850 </td>
851 <td>
852 Specify the size of the raw input in bytes. If you are encoding raw samples from stdin, you must set this option in order to be able to use --skip, --until, --cue-sheet, or other options that need to know the size of the input beforehand. If the size given is greater than what is found in the input stream, the encoder will complain about an unexpected end-of-file. If the size given is less, samples will be truncated.
853 </td>
854 </tr>
855 <tr>
856 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
857 <a name="flac_options_force_aiff_format" />
858 <span class="argument">--force-aiff-format</span>
859 </td>
860 <td>
861 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.
862 </td>
863 </tr>
864 <tr>
865 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
866 <a name="flac_options_force_raw_format" />
867 <span class="argument">--force-raw-format</span>
868 </td>
869 <td>
870 Treat the input file (or output file if decoding) as a raw file, regardless of the extension.
871 </td>
872 </tr>
873 </table>
874 </td></tr></table>
875
876 <br />
877
878 <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#EEEED4"><tr><td>
879 <table width="100%" border="1" bgcolor="#EEEED4">
880 <tr>
881 <td colspan="2" bgcolor="#D3D4C5">
882 <a name="negative_options"><font size="+1"><b>Negative Options</b></font></a>
883 </td>
884 </tr>
885 <tr>
886 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
887 <span class="argument">--no-adaptive-mid-side</span><br />
888 <span class="argument">--no-decode-through-errors</span><br />
889 <span class="argument">--no-delete-input-file</span><br />
890 <span class="argument">--no-escape-coding</span><br />
891 <span class="argument">--no-exhaustive-model-search</span><br />
892 <span class="argument">--no-lax</span><br />
893 <span class="argument">--no-mid-side</span><br />
894 <span class="argument">--no-ogg</span><br />
895 <span class="argument">--no-padding</span><br />
896 <span class="argument">--no-qlp-coeff-precision-search</span><br />
897 <span class="argument">--no-residual-gnuplot</span><br />
898 <span class="argument">--no-residual-text</span><br />
899 <span class="argument">--no-sector-align</span><br />
900 <span class="argument">--no-seektable</span><br />
901 <span class="argument">--no-silent</span><br />
902 <span class="argument">--no-verify</span>
903 </td>
904 <td>
905 Can all be used to turn off a particular option.
906 </td>
907 </tr>
908 </table>
909 </td></tr></table>
910
911 </div>
912 <div class="box_footer"></div>
913</div>
914
915<br />
916
917<div class="box">
918 <div class="box_title">
919 <a name="metaflac">metaflac</a>
920 </div>
921 <div class="box_header"></div>
922 <div class="box_body">
923 <span class="commandname">metaflac</span> is the command-line <span class="code">.flac</span> file metadata editor. You can use it to list the contents of metadata blocks, edit, delete or insert blocks, and manage padding.
924 <br /><br />
925 <span class="commandname">metaflac</span> takes a set of "options" (though some are not optional) and a set of FLAC files to operate on. There are three kinds of "options":
926 <ul>
927 <li>
Josh Coalson01fb7202004-12-30 03:53:56 +0000928 Major operations, which specify a mode of operation like listing blocks, removing blocks, etc. These will have sub-operations describing exactly what is to be done.
Josh Coalson950e3ca2005-02-09 03:37:59 +0000929 </li>
930 <li>
931 Shorthand operations, which are convenient synonyms for major operations. For example, there is a shorthand operation <span class="argument">--show-sample-rate</span> that shows just the sample rate field from the <span class="code">STREAMINFO</span> metadata block.
932 </li>
933 <li>
Josh Coalson01fb7202004-12-30 03:53:56 +0000934 Global options, which affect all the operations.
Josh Coalson950e3ca2005-02-09 03:37:59 +0000935 </li>
936 </ul>
Josh Coalson01fb7202004-12-30 03:53:56 +0000937 All of these are described in the tables below. At least one shorthand or major operation must be supplied. You can use multiple shorthand operations to do more than one thing to a file or set of files. Most of the common things to do to metadata have shorthand operations. As an example, here is how to show the MD5 signatures for a set of three FLAC files:
Josh Coalson950e3ca2005-02-09 03:37:59 +0000938 <br /><br />
939 <span class="code">metaflac --show-md5sum file1.flac file2.flac file3.flac</span>
940 <br /><br />
941 Another example; this removes all DESCRIPTION and COMMENT tags in a set of FLAC files, and uses the <span class="argument">--preserve-modtime</span> global option to keep the FLAC file modification times the same (usually when files are edited the modification time is set to the current time):
942 <br /><br />
943 <span class="code">metaflac --preserve-modtime --remove-tag=DESCRIPTION --remove-tag=COMMENT file1.flac file2.flac file3.flac</span>
944 <br /><br />
Josh Coalson01fb7202004-12-30 03:53:56 +0000945
Josh Coalson950e3ca2005-02-09 03:37:59 +0000946 <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#EEEED4"><tr><td>
947 <table width="100%" border="1" bgcolor="#EEEED4">
948 <tr>
949 <td colspan="2" bgcolor="#D3D4C5">
950 <a name="global_options"><font size="+1"><b>Global Options</b></font></a>
951 </td>
952 </tr>
953 <tr>
954 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
955 <a name="metaflac_options_preserve_modtime" />
956 <span class="argument">--preserve-modtime</span>
957 </td>
958 <td>
959 Preserve the original modification time in spite of edits.
960 </td>
961 </tr>
962 <tr>
963 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
964 <a name="metaflac_options_with_filename" />
965 <span class="argument">--with-filename</span>
966 </td>
967 <td>
968 Prefix each output line with the FLAC file name (the default if more than one FLAC file is specified).
969 </td>
970 </tr>
971 <tr>
972 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
973 <a name="metaflac_options_no_filename" />
974 <span class="argument">--no-filename</span>
975 </td>
976 <td>
977 Do not prefix each output line with the FLAC file name (the default if only one FLAC file is specified)
978 </td>
979 </tr>
980 <tr>
981 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
982 <a name="metaflac_options_no_utf8_convert" />
983 <span class="argument">--no-utf8-convert</span>
984 </td>
985 <td>
986 Do not convert tags from UTF-8 to local charset, or vice versa. This is useful for scripts.
987 </td>
988 </tr>
989 <tr>
990 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
991 <a name="metaflac_options_dont_use_padding" />
992 <span class="argument">--dont-use-padding</span>
993 </td>
994 <td>
995 By default <span class="commandname">metaflac</span> tries to use padding where possible to avoid rewriting the entire file if the metadata size changes. Use this option to tell metaflac to not take advantage of padding this way.
996 </td>
997 </tr>
998 </table>
999 </td></tr></table>
Josh Coalson01fb7202004-12-30 03:53:56 +00001000
Josh Coalson950e3ca2005-02-09 03:37:59 +00001001 <br />
Josh Coalson01fb7202004-12-30 03:53:56 +00001002
Josh Coalson950e3ca2005-02-09 03:37:59 +00001003 <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#EEEED4"><tr><td>
1004 <table width="100%" border="1" bgcolor="#EEEED4">
1005 <tr>
1006 <td colspan="2" bgcolor="#D3D4C5">
1007 <a name="shorthand_operations"><font size="+1"><b>Shorthand Operations</b></font></a>
1008 </td>
1009 </tr>
1010 <tr>
1011 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1012 <a name="metaflac_shorthand_show_md5sum" />
1013 <span class="argument">--show-md5sum</span>
1014 </td>
1015 <td>
1016 Show the MD5 signature from the <span class="code">STREAMINFO</span> block.
1017 </td>
1018 </tr>
1019 <tr>
1020 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1021 <a name="metaflac_shorthand_show_min_blocksize" />
1022 <span class="argument">--show-min-blocksize</span>
1023 </td>
1024 <td>
1025 Show the minimum block size from the <span class="code">STREAMINFO</span> block.
1026 </td>
1027 </tr>
1028 <tr>
1029 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1030 <a name="metaflac_shorthand_show_max_blocksize" />
1031 <span class="argument">--show-max-blocksize</span>
1032 </td>
1033 <td>
1034 Show the maximum block size from the <span class="code">STREAMINFO</span> block.
1035 </td>
1036 </tr>
1037 <tr>
1038 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1039 <a name="metaflac_shorthand_show_min_framesize" />
1040 <span class="argument">--show-min-framesize</span>
1041 </td>
1042 <td>
1043 Show the minimum frame size from the <span class="code">STREAMINFO</span> block.
1044 </td>
1045 </tr>
1046 <tr>
1047 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1048 <a name="metaflac_shorthand_show_max_framesize" />
1049 <span class="argument">--show-max-framesize</span>
1050 </td>
1051 <td>
1052 Show the maximum frame size from the <span class="code">STREAMINFO</span> block.
1053 </td>
1054 </tr>
1055 <tr>
1056 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1057 <a name="metaflac_shorthand_show_sample_rate" />
1058 <span class="argument">--show-sample-rate</span>
1059 </td>
1060 <td>
1061 Show the sample rate from the <span class="code">STREAMINFO</span> block.
1062 </td>
1063 </tr>
1064 <tr>
1065 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1066 <a name="metaflac_shorthand_show_channels" />
1067 <span class="argument">--show-channels</span>
1068 </td>
1069 <td>
1070 Show the number of channels from the <span class="code">STREAMINFO</span> block.
1071 </td>
1072 </tr>
1073 <tr>
1074 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1075 <a name="metaflac_shorthand_show_bps" />
1076 <span class="argument">--show-bps</span>
1077 </td>
1078 <td>
1079 Show the # of bits per sample from the <span class="code">STREAMINFO</span> block.
1080 </td>
1081 </tr>
1082 <tr>
1083 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1084 <a name="metaflac_shorthand_show_total_samples" />
1085 <span class="argument">--show-total-samples</span>
1086 </td>
1087 <td>
1088 Show the total # of samples from the <span class="code">STREAMINFO</span> block.
1089 </td>
1090 </tr>
1091 <tr>
1092 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1093 <a name="metaflac_shorthand_show_vendor_tag" />
1094 <span class="argument">--show-vendor-tag</span>
1095 </td>
1096 <td>
1097 Show the vendor string from the <span class="code">VORBIS_COMMENT</span> block.
1098 </td>
1099 </tr>
1100 <tr>
1101 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1102 <a name="metaflac_shorthand_show_tag" />
1103 <span class="argument">--show-tag=NAME</span>
1104 </td>
1105 <td>
1106 Show all tags where the the field name matches <span class="argument">NAME</span>.
1107 </td>
1108 </tr>
1109 <tr>
1110 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1111 <a name="metaflac_shorthand_remove_tag" />
1112 <span class="argument">--remove-tag=NAME</span>
1113 </td>
1114 <td>
1115 Remove all tags whose field name is <span class="argument">NAME</span>.
1116 </td>
1117 </tr>
1118 <tr>
1119 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1120 <a name="metaflac_shorthand_remove_first_tag" />
1121 <span class="argument">--remove-first-tag=NAME</span>
1122 </td>
1123 <td>
1124 Remove first tag whose field name is <span class="argument">NAME</span>.
1125 </td>
1126 </tr>
1127 <tr>
1128 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1129 <a name="metaflac_shorthand_remove_all_tags" />
1130 <span class="argument">--remove-all-tags</span>
1131 </td>
1132 <td>
1133 Remove all tags, leaving only the vendor string.
1134 </td>
1135 </tr>
1136 <tr>
1137 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1138 <a name="metaflac_shorthand_set_tag" />
1139 <span class="argument">--set-tag=FIELD</span>
1140 </td>
1141 <td>
1142 Add a tag. The <span class="argument">FIELD</span> must comply with the Vorbis comment spec, of the form <span class="argument">NAME=VALUE</span>. If there is currently no tag block, one will be created.
1143 </td>
1144 </tr>
1145 <tr>
1146 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
Josh Coalson26c82352006-05-18 07:57:16 +00001147 <a name="metaflac_shorthand_set_tag_from_file" />
1148 <span class="argument">--set-tag-from-file=FIELD</span>
1149 </td>
1150 <td>
1151 Like <a href="#metaflac_shorthand_set_tag"><span class="argument">--set-tag</span></a>, except the VALUE is a filename whose contents will be read verbatim to set the tag value. Unless <a href="#metaflac_options_no_utf8_convert"><span class="argument">--no-utf8-convert</span></a> is specified, the contents will be converted to UTF-8 from the local charset. This can be used to store a cuesheet in a tag (e.g. <span class="argument">--set-tag-from-file="CUESHEET=image.cue"</span>). Do not try to store binary data in tag fields! Use APPLICATION blocks for that.
1152 </td>
1153 </tr>
1154 <tr>
1155 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
Josh Coalson950e3ca2005-02-09 03:37:59 +00001156 <a name="metaflac_shorthand_import_tags_from" />
1157 <span class="argument">--import-tags-from=FILE</span>
1158 </td>
1159 <td>
Josh Coalson26c82352006-05-18 07:57:16 +00001160 Import tags from a file. Use '-' for stdin. Each line should be of the form <span class="argument">NAME=VALUE</span>. Multi-line comments are currently not supported. Specify <span class="argument">--remove-all-tags</span> and/or <a href="#metaflac_options_no_utf8_convert"><span class="argument">--no-utf8-convert</span></a> before <span class="argument">--import-tags-from</span> if necessary.
Josh Coalson950e3ca2005-02-09 03:37:59 +00001161 </td>
1162 </tr>
1163 <tr>
1164 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1165 <a name="metaflac_shorthand_export_tags_to" />
1166 <span class="argument">--export-tags-to=FILE</span>
1167 </td>
1168 <td>
Josh Coalson26c82352006-05-18 07:57:16 +00001169 Export tags to a file. Use '-' for stdin. Each line will be of the form <span class="argument">NAME=VALUE</span>. Specify <a href="#metaflac_options_no_utf8_convert"><span class="argument">--no-utf8-convert</span></a> if necessary.
Josh Coalson950e3ca2005-02-09 03:37:59 +00001170 </td>
1171 </tr>
1172 <tr>
1173 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1174 <a name="metaflac_shorthand_import_cuesheet_from" />
1175 <span class="argument">--import-cuesheet-from=FILE</span>
1176 </td>
1177 <td>
1178 Import a cuesheet from a file. Use '-' for stdin. Only one FLAC file may be specified. A seekpoint will be added for each index point in the cuesheet to the <span class="code">SEEKTABLE</span> unless <span class="argument">--no-cued-seekpoints</span> is specified.
1179 </td>
1180 </tr>
1181 <tr>
1182 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1183 <a name="metaflac_shorthand_export_cuesheet_to" />
1184 <span class="argument">--export-cuesheet-to=FILE</span>
1185 </td>
1186 <td>
1187 Export <span class="code">CUESHEET</span> block to a cuesheet file, suitable for use by CD authoring software. Use '-' for stdout. Only one FLAC file may be specified on the command line.
1188 </td>
1189 </tr>
1190 <tr>
1191 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1192 <a name="metaflac_shorthand_add_replay_gain" />
1193 <span class="argument">--add-replay-gain</span>
1194 </td>
1195 <td>
1196 Calculates the title and album gains/peaks of the given FLAC files as if all the files were part of one album, then stores them in the <span class="code">VORBIS_COMMENT</span> block. The tags are the same as those used by <span class="commandname">vorbisgain</span>. Existing ReplayGain tags will be replaced. If only one FLAC file is given, the album and title gains will be the same. Since this operation requires two passes, it is always executed last, after all other operations have been completed and written to disk. All FLAC files specified must have the same resolution, sample rate, and number of channels. The sample rate must be one of 8, 11.025, 12, 16, 22.05, 24, 32, 44.1, or 48 kHz.
1197 </td>
1198 </tr>
1199 <tr>
1200 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
Josh Coalson83b8d282005-08-31 00:30:41 +00001201 <a name="metaflac_shorthand_remove_replay_gain" />
1202 <span class="argument">--remove-replay-gain</span>
1203 </td>
1204 <td>
1205 Removes the ReplayGain tags.
1206 </td>
1207 </tr>
1208 <tr>
1209 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
Josh Coalson950e3ca2005-02-09 03:37:59 +00001210 <a name="metaflac_shorthand_add_seekpoint" />
1211 <span class="argument">--add-seekpoint={#|X|#x|#s}</span>
1212 </td>
1213 <td>
1214 Add seek points to a <span class="code">SEEKTABLE</span> block:<br />
1215 <ul>
1216 <li>
1217 <span class="argument">#&nbsp;</span> : a specific sample number for a seek point
1218 </li>
1219 <li>
1220 <span class="argument">X&nbsp;</span> : a placeholder point (always goes at the end of the <span class="code">SEEKTABLE</span>)
1221 </li>
1222 <li>
1223 <span class="argument">#x</span> : # evenly spaced seekpoints, the first being at sample 0
1224 </li>
1225 <li>
1226 <span class="argument">#s</span> : a seekpoint every # seconds; # does not have to be a whole number, it can be, for example, <span class="argument">9.5</span>, meaning a seekpoint every 9.5 seconds
1227 </li>
1228 </ul>
1229 If no <span class="code">SEEKTABLE</span> block exists, one will be created. If one already exists, points will be added to the existing table, and any duplicates will be turned into placeholder points.<br />
1230 You may use many <span class="argument">--add-seekpoint</span> options; the resulting <span class="code">SEEKTABLE</span> will be the unique-ified union of all such values. Example: <span class="argument">--add-seekpoint=100x --add-seekpoint=3.5s</span> will add 100 evenly spaced seekpoints and a seekpoint every 3.5 seconds.<br />
1231 </td>
1232 </tr>
1233 <tr>
1234 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1235 <a name="metaflac_shorthand_add_padding" />
1236 <span class="argument">--add-padding=#</span>
1237 </td>
1238 <td>
1239 Add a padding block of the given length (in bytes). The overall length of the new block will be 4 + length; the extra 4 bytes is for the metadata block header.
1240 </td>
1241 </tr>
1242 </table>
1243 </td></tr></table>
Josh Coalson01fb7202004-12-30 03:53:56 +00001244
Josh Coalson950e3ca2005-02-09 03:37:59 +00001245 <br />
Josh Coalson01fb7202004-12-30 03:53:56 +00001246
Josh Coalson950e3ca2005-02-09 03:37:59 +00001247 <table width="100%" border="0" cellspacing="0" cellpadding="0" bgcolor="#EEEED4"><tr><td>
1248 <table width="100%" border="1" bgcolor="#EEEED4">
1249 <tr>
1250 <td colspan="2" bgcolor="#D3D4C5">
1251 <a name="major_operations"><font size="+1"><b>Major Operations</b></font></a>
1252 </td>
1253 </tr>
1254 <tr>
1255 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1256 <a name="metaflac_operations_version" />
1257 <span class="argument">--version</span>
1258 </td>
1259 <td>
1260 Show the metaflac version number.
1261 </td>
1262 </tr>
1263 <tr>
1264 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1265 <a name="metaflac_operations_list" />
1266 <span class="argument">--list</span>
1267 </td>
1268 <td>
1269 List the contents of one or more metadata blocks to stdout. By default, all metadata blocks are listed in text format. Use the following options to change this behavior:<br /><br />
Josh Coalson01fb7202004-12-30 03:53:56 +00001270
Josh Coalson950e3ca2005-02-09 03:37:59 +00001271 <span class="argument">--block-number=#[,#[...]]</span><br />
1272 An optional comma-separated list of block numbers to display. The first block, the <span class="code">STREAMINFO</span> block, is block 0.<br /><br />
Josh Coalson5e5fc012002-07-16 16:09:53 +00001273
Josh Coalson950e3ca2005-02-09 03:37:59 +00001274 <span class="argument">--block-type=type[,type[...]]</span><br />
1275 <span class="argument">--except-block-type=type[,type[...]]</span><br />
1276 An optional comma-separated list of block types to be included or ignored with this option. Use only one of <span class="argument">--block-type</span> or <span class="argument">--except-block-type</span>. The valid block types are: <span class="code">STREAMINFO</span>, <span class="code">PADDING</span>, <span class="code">APPLICATION</span>, <span class="code">SEEKTABLE</span>, <span class="code">VORBIS_COMMENT</span>. You may narrow down the types of <span class="code">APPLICATION</span> blocks displayed as follows:<br />
1277 <table border="1">
1278 <tr>
1279 <td><span class="argument">APPLICATION:abcd</span></td>
1280 <td>The <span class="code">APPLICATION</span> block(s) whose textual representation of the 4-byte ID is "abcd"</td>
1281 </tr>
1282 <tr>
1283 <td><span class="argument">APPLICATION:0xXXXXXXXX</span></td>
1284 <td>The <span class="code">APPLICATION</span> block(s) whose hexadecimal big- endian representation of the 4-byte ID is "0xXXXXXXXX". For the example "abcd" above the hexadecimal equivalalent is 0x61626364</td>
1285 </tr>
1286 </table>
1287 <br />
Josh Coalson5e5fc012002-07-16 16:09:53 +00001288
Josh Coalson950e3ca2005-02-09 03:37:59 +00001289 NOTE: if both <span class="argument">--block-number</span> and <span class="argument">--[except-]block-type</span> are specified, the result is the logical AND of both arguments.<br /><br />
Josh Coalson5e5fc012002-07-16 16:09:53 +00001290
Josh Coalson950e3ca2005-02-09 03:37:59 +00001291 <span class="argument">--application-data-format=hexdump|text</span><br />
1292 If the application block you are displaying contains binary data but your <span class="argument">--data-format=text</span>, you can display a hex dump of the application data contents instead using <span class="argument">--application-data-format=hexdump</span>.
1293 </td>
1294 </tr>
1295 <tr>
1296 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1297 <a name="metaflac_operations_remove" />
1298 <span class="argument">--remove</span>
1299 </td>
1300 <td>
1301 Remove one or more metadata blocks from the metadata. Unless <span class="argument">--dont-use-padding</span> is specified, the blocks will be replaced with padding. You may not remove the <span class="code">STREAMINFO</span> block.<br /><br />
Josh Coalson5e5fc012002-07-16 16:09:53 +00001302
Josh Coalson950e3ca2005-02-09 03:37:59 +00001303 <span class="argument">--block-number=#[,#[...]]</span><br />
1304 <span class="argument">--block-type=type[,type[...]]</span><br />
1305 <span class="argument">--except-block-type=type[,type[...]]</span><br />
1306 See <a href="#metaflac_operations_list"><span class="argument">--list</span></a> above for usage.<br /><br />
Josh Coalson5e5fc012002-07-16 16:09:53 +00001307
Josh Coalson950e3ca2005-02-09 03:37:59 +00001308 NOTE: if both <span class="argument">--block-number</span> and <span class="argument">--[except-]block-type</span> are specified, the result is the logical AND of both arguments.
1309 </td>
1310 </tr>
1311 <tr>
1312 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1313 <a name="metaflac_operations_remove_all" />
1314 <span class="argument">--remove-all</span>
1315 </td>
1316 <td>
1317 Remove all metadata blocks (except the <span class="code">STREAMINFO</span> block) from the metadata. Unless <span class="argument">--dont-use-padding</span> is specified, the blocks will be replaced with padding.
1318 </td>
1319 </tr>
1320 <tr>
1321 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1322 <a name="metaflac_operations_merge_padding" />
1323 <span class="argument">--merge-padding</span>
1324 </td>
1325 <td>
1326 Merge adjacent <span class="code">PADDING</span> blocks into single blocks.
1327 </td>
1328 </tr>
1329 <tr>
1330 <td nowrap="nowrap" align="right" valign="top" bgcolor="#F4F4CC">
1331 <a name="metaflac_operations_sort_padding" />
1332 <span class="argument">--sort-padding</span>
1333 </td>
1334 <td>
1335 Move all <span class="code">PADDING</span> blocks to the end of the metadata and merge them into a single block.
1336 </td>
1337 </tr>
1338 </table>
1339 </td></tr></table>
Josh Coalson5e5fc012002-07-16 16:09:53 +00001340
Josh Coalson950e3ca2005-02-09 03:37:59 +00001341 </div>
1342 <div class="box_footer"></div>
1343</div>
1344
1345<br />
1346
1347<div class="box">
1348 <div class="box_title">
1349 <a name="plugins"></a><a name="xmms_plugin">xmms plugin</a>
1350 </div>
1351 <div class="box_header"></div>
1352 <div class="box_body">
1353 All that is necessary is to copy <span class="code">libxmms-flac.so</span> to the directory where XMMS looks for input plugins (usually <span class="code">/usr/lib/xmms/Input</span> or <span class="code">$HOME/.xmms/Input</span>). There is nothing else to configure. Make sure to restart XMMS before trying to play any <span class="code">.flac</span> files.
1354 </div>
1355 <div class="box_footer"></div>
1356</div>
1357
1358<br />
1359
1360<div class="box">
1361 <div class="box_title">
1362 <a name="winamp2_plugin">winamp2 plugin</a>
1363 </div>
1364 <div class="box_header"></div>
1365 <div class="box_body">
1366 The Winamp plugin should work for both Winamp2 and Winamp5. If you are using Winamp 2.x, all that is necessary is to copy <span class="code">in_flac.dll</span> to the <span class="code">Plugins/</span> directory of your Winamp installation. There is nothing else to configure. Make sure to restart Winamp before trying to play any <span class="code">.flac</span> files.
1367 </div>
1368 <div class="box_footer"></div>
1369</div>
1370
1371<br />
1372
1373<div class="box">
1374 <div class="box_title">
1375 <a name="bugs">known bugs</a>
1376 </div>
1377 <div class="box_header"></div>
1378 <div class="box_body">
1379 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.
1380 <br /><br />
Josh Coalson318bc932005-02-02 01:53:13 +00001381 The following are major known bugs in the current (1.1.2) release:
Josh Coalson950e3ca2005-02-09 03:37:59 +00001382 <ul>
1383 <li>
Josh Coalson30374cd2004-09-10 00:26:11 +00001384 (none)
Josh Coalson950e3ca2005-02-09 03:37:59 +00001385 </li>
1386 </ul>
Josh Coalson30374cd2004-09-10 00:26:11 +00001387 The following are major known bugs in the 1.1.0 release:
Josh Coalson950e3ca2005-02-09 03:37:59 +00001388 <ul>
1389 <li>
Josh Coalson473eaf32003-01-25 06:04:14 +00001390 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 Coalson950e3ca2005-02-09 03:37:59 +00001391 </li>
1392 </ul>
Josh Coalson129ef7b2004-09-08 01:12:01 +00001393 The following are major known bugs in the 1.0.4 release:
Josh Coalson950e3ca2005-02-09 03:37:59 +00001394 <ul>
1395 <li>
1396 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 <span class="code">CUESHEET</span> metadata block will not decode in 1.0.x decoders.
1397 </li>
1398 <li>
1399 <span class="commandname">metaflac</span> 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.
1400 </li>
1401 <li>
1402 There is an odd bug in <span class="commandname">metaflac</span> such that you must always use the <span class="argument">--dont-use-padding</span> option with <span class="argument">--add-padding</span> or the padding block won't be written. This is fixed in CVS.
1403 </li>
1404 </ul>
1405 </div>
1406 <div class="box_footer"></div>
1407</div>
Josh Coalson5e5fc012002-07-16 16:09:53 +00001408
Josh Coalson950e3ca2005-02-09 03:37:59 +00001409<br />
Josh Coalson5e5fc012002-07-16 16:09:53 +00001410
Josh Coalson950e3ca2005-02-09 03:37:59 +00001411<div class="box">
1412 <div class="box_title">
1413 <a name="monkey">monkey</a>
1414 </div>
1415 <div class="box_header"></div>
1416 <div class="box_body">
Josh Coalson5e5fc012002-07-16 16:09:53 +00001417 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:
Josh Coalson950e3ca2005-02-09 03:37:59 +00001418 <ul>
1419 <li>Copy <span class="commandname">flac.exe</span> and <span class="commandname">flac_ren.exe</span> to the <span class="code">External/</span> directory of the Monkey's Audio installation.</li>
1420 <li>
Josh Coalson5e5fc012002-07-16 16:09:53 +00001421 Choose a supported encoder to replace:
Josh Coalson950e3ca2005-02-09 03:37:59 +00001422 <ul>
1423 <li>Shorten - copy <span class="commandname">flac_mac.exe</span> on top of <span class="commandname">External/shortn32.exe</span></li>
1424 <li>WavPack - copy <span class="commandname">flac_mac.exe</span> on top of both <span class="commandname">External/wavpack.exe</span> and <span class="commandname">External/wvunpack.exe</span></li>
1425 <li>RKAU - copy <span class="commandname">flac_mac.exe</span> on top of <span class="commandname">External/rkau.exe</span></li>
1426 </ul>
Josh Coalson5e5fc012002-07-16 16:09:53 +00001427 If you choose WavPack you will also be able to use the WavPack Configuration menu to add flac options.
Josh Coalson950e3ca2005-02-09 03:37:59 +00001428 </li>
1429 <li>Now you can encode FLAC files as if you were using the replaced encoder. The renamed <span class="commandname">flac_mac.exe</span> utility will call <span class="commandname">flac.exe</span> and afterwards, <span class="commandname">flac_ren.exe</span> will rename the resulting file to have the .flac extension.</li>
1430 </ul>
1431 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.
1432 </div>
1433 <div class="box_footer"></div>
1434</div>
Josh Coalson5e5fc012002-07-16 16:09:53 +00001435
1436
Josh Coalson950e3ca2005-02-09 03:37:59 +00001437<div class="copyright">
Josh Coalson0395dac2006-04-25 06:59:33 +00001438 Copyright (c) 2000,2001,2002,2003,2004,2005,2006 Josh Coalson
Josh Coalson950e3ca2005-02-09 03:37:59 +00001439</div>
Josh Coalson5e5fc012002-07-16 16:09:53 +00001440
Josh Coalson950e3ca2005-02-09 03:37:59 +00001441</body>
1442</html>