Commit b25a9bf6 authored by Josh Coalson's avatar Josh Coalson
Browse files

update for 1.0.3 release

parent 5ee2baa5
This diff is collapsed.
......@@ -146,13 +146,13 @@
<P>
FLAC is open to third-party developers who want to add support for FLAC into their programs. All the necessary functionality is contained the library libFLAC which is licensed under the <A HREF="http://www.gnu.org/copyleft/lesser.html">LGPL</A>. The relevant documentation here is:
<UL>
<LI>The <A HREF="documentation.html#libFLAC">libFLAC API documentation</A></LI>
<LI>The <A HREF="documentation.html#libflac">libFLAC API documentation</A> and <A HREF="documentation.html#libflacpp">libFLAC++ API documentation</A></LI>
<LI>The <A HREF="format.html">formal description</A> of the FLAC format.</LI>
<LI>The <A HREF="id.html">ID registration page</A> for registering an ID if you need to write custom metadata.</LI>
</UL>
</P>
<P>
There also are several examples in the FLAC code base of the use of libFLAC that may also be helpful. Visit the <A HREF="download.html">download page</A> for instructions on how to get the source.
There also are several examples in the FLAC code base of the use of libFLAC and libFLAC++ that may also be helpful. Visit the <A HREF="download.html">download page</A> for instructions on how to get the source.
</P>
</FONT>
</TD></TR>
......
......@@ -84,6 +84,7 @@
<LI><A HREF="#metaflac">metaflac</A> - the usage of the command-line FLAC metadata editor <B><TT>metaflac</TT></B>.</LI>
<LI><A HREF="#plugins">plugins</A> - documentation for the various input plugins.</LI>
<LI><A HREF="#libflac">libFLAC API</A> - for developers who want to add FLAC support to their programs.</LI>
<LI><A HREF="#libflacpp">libFLAC++ API</A> - the documentation for object layer around libFLAC.</LI>
<LI><A HREF="#bugs">bugs</A> - known bugs.</LI>
<LI><A HREF="#monkey">How to add FLAC support to the Monkey's Audio GUI</A></LI>
</UL>
......@@ -737,18 +738,10 @@
<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#EEEED4">
<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
<P>
<B><TT>metaflac</TT></B> is the command-line <TT>.flac</TT> file metadata editor. Right now it just lists the contents of all metadata blocks in a .flac file, but soon it will allow you to insert, delete, and edit blocks.
<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.
</P>
<P>
Currently <B><TT>metaflac</TT></B> can be invoked only one way:
<UL>
<LI>
Listing: metaflac [-v] inputfile
</LI>
</UL>
</P>
<P>
<TT>inputfile</TT> may be "-" for stdin. If <TT>-v</TT> is used, you will get verbose output.
The documentation for <B><TT>metaflac</TT></B> is currently being rewritten, but the usage screen should explain it pretty well. Do <TT>metaflac --help</TT> to see the full usage.
</P>
</FONT>
</TD></TR>
......@@ -757,6 +750,7 @@
</TD></TR>
</TABLE>
<A NAME="plugins"></A>
<TABLE WIDTH="100%" CELLPADDING="5" CELLSPACING="5" BORDER="0">
<TR><TD>
......@@ -836,7 +830,10 @@
<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#EEEED4">
<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
<P>
The FLAC library <B><TT>libFLAC</TT></B> is a C implementation of reference encoders and decoders. By linking against <B><TT>libFLAC</TT></B> and writing a little code, it is relatively easy to add FLAC support to another program. The library is licensed under the <A HREF="http://www.gnu.org/copyleft/lesser.html">LGPL</A>. Complete source code of <B><TT>libFLAC</TT></B> as well as the command-line encoder and plugins is available and is a useful source of examples.
The FLAC library <B><TT>libFLAC</TT></B> is a C implementation of reference encoders and decoders, and a metadata interface. By linking against <B><TT>libFLAC</TT></B> and writing a little code, it is relatively easy to add FLAC support to another program. The library is licensed under the <A HREF="http://www.gnu.org/copyleft/lesser.html">LGPL</A>. Complete source code of <B><TT>libFLAC</TT></B> as well as the command-line encoder and plugins is available and is a useful source of examples.
</P>
<P>
There is also a C++ object wrapper around <B><TT>libFLAC</TT></B> called <B><TT>libFLAC++</TT></B>; see the documentation <A HREF="#libflacpp">below</A>.
</P>
<P>
<B><TT>libFLAC</TT></B> usually only requires the standard C library and C math library. In particular, threading is not used so there is no dependency on a thread library. However, <B><TT>libFLAC</TT></B> does not use global variables and should be thread-safe.
......@@ -845,13 +842,16 @@
The <B><TT>libFLAC</TT></B> interface is described in the public header files in the include/FLAC directory. The public headers and the compiled library are all that is needed to compile and link against the library. Note that none of the code in src/libFLAC/, including the private header files in src/libFLAC/include/ is required.
</P>
<P>
The basic usage of <B><TT>libFLAC</TT></B> is as follows:
Aside from encoders and decoders, <B><TT>libFLAC</TT></B> provides a powerful metadata interface for manipulating metadata in FLAC files. It allows the user to add, delete, and modify FLAC metadata blocks and it can automatically take advantage of PADDING blocks to avoid rewriting the entire FLAC file when changing the size of the metadata. The documentation for the metadata interface is currently being rewritten but there are extensive usage comments in the header file <TT>include/FLAC/metadata.h</TT>.
</P>
<P>
The basic usage of a <B><TT>libFLAC</TT></B> encoder or decoder is as follows:
<OL>
<LI>The program creates an instance of a decoder or encoder using <TT>*_new()</TT>.</LI>
<LI>The program sets the parameters of the instance and callbacks for reading, writing, error reporting, and metadata reporting using <TT>*_set_*()</TT> functions.</LI>
<LI>The program initializes the instance to validate the parameters and prepare for decoding/encoding using <TT>*_init()</TT>.</LI>
<LI>The program calls <TT>*_process_*()</TT> functions to encode or decode data, which subsequently calls the callbacks.</LI>
<LI>The program finishes the instance with <TT>*_finish()</TT>, which flushes the input and output.</LI>
<LI>The program finishes the instance with <TT>*_finish()</TT>, which flushes the input and output and resets the encoder/decoder to the unitialized state.</LI>
<LI>The instance may be used again or deleted with <TT>*_delete()</TT>.</LI>
</OL>
</P>
......@@ -875,12 +875,12 @@
<UL>
<LI>Read callback - This function will be called when the decoder needs more input data. The address of the buffer to be filled is supplied, along with the number of bytes the buffer can hold. The callback may choose to supply less data and modify the byte count but must be careful not to overflow the buffer. The callback then returns a status code chosen from FLAC__StreamDecoderReadStatus.</LI>
<LI>Write callback - This function will be called when the decoder has decoded a single frame of data. The decoder will pass the frame metadata as well as an array of pointers (one for each channel) pointing to the decoded audio.</LI>
<LI>Metadata callback - This function will be called when the decoder has decoded a metadata block. There will always be one STREAMINFO block per stream, followed by zero or more other metadata blocks. These will be supplied by the decoder in the same order as they appear in the stream and always before the first audio frame. The metadata block that is passed in must not be modified, and it doesn't live beyond the callback, so you should make a copy of it with <TT>FLAC__metadata_object_clone()</TT> if you will need it elsewhere.</LI>
<LI>Metadata callback - This function will be called when the decoder has decoded a metadata block. There will always be one STREAMINFO block per stream, followed by zero or more other metadata blocks. These will be supplied by the decoder in the same order as they appear in the stream and always before the first audio frame (i.e. write callback). The metadata block that is passed in must not be modified, and it doesn't live beyond the callback, so you should make a copy of it with <TT>FLAC__metadata_object_clone()</TT> if you will need it elsewhere. Since metadata blocks can potentially be large, you can instruct the decoder to pass or filter blocks with <TT>FLAC__stream_decoder_set_metadata_*()</TT> calls.</LI>
<LI>Error callback - This function will be called whenever an error occurs during decoding.</LI>
</UL>
</P>
<P>
Once the decoder is initialized, the program will call one of several functions to stimulate the decoding process:
Once the decoder is initialized, your program will call one of several functions to start the decoding process:
<UL>
<LI><B><TT>FLAC__stream_decoder_process_whole_stream()</TT></B> - Tells the decoder to start and continue processing the stream until the read callback says <TT>FLAC__STREAM_DECODER_READ_END_OF_STREAM</TT> or <TT>FLAC__STREAM_DECODER_READ_ABORT</TT>.</LI>
<LI><B><TT>FLAC__stream_decoder_process_metadata()</TT></B> - Tells the decoder to start processing the stream and stop upon reaching the first audio frame.</LI>
......@@ -948,9 +948,7 @@
<LI><B><TT>min_residual_partition_order</TT></B>, <B><TT>max_residual_partition_order</TT></B> - 0 to estimate Rice parameter based on residual variance; &gt; 0 to partition the residual and use parameter for each based on mean; <TT>min_residual_partition_order</TT> and <TT>max_residual_partition_order</TT> specify the min and max Rice partition order.</LI>
<LI><B><TT>rice_parameter_search_dist</TT></B> - 0 to try only calculated parameter k; else try all [k-<TT>rice_parameter_search_dist</TT>..k+<TT>rice_parameter_search_dist</TT>] parameters and use the best.</LI>
<LI><B><TT>total_samples_estimate</TT></B> - May be set to 0 if unknown. Otherwise, set this to the number of samples to be encoded. This will allow the STREAMINFO block to be more accurate during the first pass in the event that the encoder can't seek back to the beginning of the output file to write the updated STREAMINFO block.</LI>
<LI><B><TT>seek_table</TT></B> - Optional seek table to prepend; NULL implies no seek table.</LI>
<LI><B><TT>padding</TT></B> - Length of PADDING block to add (goes after seek table); -1 implies do not add a PADDING block. Remember that this is length of the padding; the length of the overall PADDING block will be 4 bytes larger because of the metadata block header.</LI>
<LI><B><TT>last_metadata_is_last</TT></B> - The value the encoder will use for the 'is_last' flag of the last metadata block it writes. In normal usage you would set this to true, but if you will be manually inserting more metadata blocks between the time of the first write callback (when the encoder sends the <TT>fLaC</TT> header and metadata) and the time actual audio encoding starts then set this to false.</LI>
<LI><B><TT>metadata</TT></B> - Optional array of pointers to metadata blocks to be written; NULL implies no metadata. The STREAMINFO block is always written automatically and must not be present in the array of pointers.</LI>
</UL>
</P>
<P>
......@@ -981,13 +979,35 @@
<B>METADATA</B>
</P>
<P>
For programs that write their own APPLICATION metadata, it is advantageous to instruct the encoder to write a PADDING block of the correct size, so that instead of rewriting the whole stream after encoding, the program can just overwrite the PADDING block. If only the maximum size of the APPLICATION block is known, the program can write a slightly larger padding block, then split it after encoding into an APPLICATION block and a PADDING block.
For programs that write their own metadata, but that do not know the actual metadata until after encoding, it is advantageous to instruct the encoder to write a PADDING block of the correct size, so that instead of rewriting the whole stream after encoding, the program can just overwrite the PADDING block. If only the maximum size of the metadata is known, the program can write a slightly larger padding block, then split it after encoding.
</P>
<P>
In the case where the size of the APPLICATION block data is known ahead of time, the required size of the padding block can be easily calculated. If the APPLICATION block data length in bytes (not including the APPLICATION metadata block header) is N bytes, the size given to the FLAC__StreamEncoder instance before initialization is simply N+4. This accounts for the extra space needed to store the APPLICATION ID.
Make sure you understand how lengths are calculated. All FLAC metadata blocks have a 4 byte header which contains the type and length. This length does not include the 4 bytes of the header. See the <A HREF="format.html#metadata_block">format page</A> for the specification of metadata blocks and their lengths.
</P>
</FONT>
</TD></TR>
</TABLE>
<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>
</TD></TR>
</TABLE>
<TABLE WIDTH="100%" CELLPADDING="5" CELLSPACING="5" BORDER="0">
<TR><TD>
<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>
<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#D3D4C5">
<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
<A NAME="libflacpp"><B><FONT SIZE="+2">libFLAC++</FONT></B>
</FONT></TD></TR>
</TABLE>
<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>
<TABLE CELLSPACING="0" CELLPADDING="3" WIDTH="100%" BORDER="0" BGCOLOR="#EEEED4">
<TR><TD><FONT FACE="Lucida,Verdana,Helvetica,Arial">
<P>
In the case where only the maximum size is known, say, to be N bytes, the required padding size would be N+8. Four for the APPLICATION ID as before, and four for the extra PADDING block that will fill up the remainder. At the end of the encoding, when the APPLICATION block data length is known, say, to be M bytes, the original PADDING block would be overwritten with the APPLICATION block and a PADDING block of size N-M.
<B><TT>libFLAC++</TT></B> is a C++ object wrapper around <B><TT>libFLAC</TT></B>. It provides classed for the encoders and decoders as well as the metadata interface.
</P>
<P>
The documentation for <B><TT>libFLAC++</TT></B> is currently being rewritten. As a wrapper it is actually quite simple. The method names and semantics generally follow those in the C layer and comments in the header files specify where there are differences.
</P>
</FONT>
</TD></TR>
......@@ -1017,10 +1037,7 @@
<P>
<UL>
<LI>
Encoding/decoding with <B><TT>flac</TT></B> through pipes on Windows, using the binary distribution, will corrupt piped data. This has been fixed in CVS. This bug does not occur if you are compiling the source using Cygwin. Use the -V option on Windows to verify that pipes are working in your configuration.
</LI>
<LI>
If you build <B><TT>flac</TT></B> from sources without Ogg support, or are using a binary built without Ogg support, encoding may yield a FLAC file with an invalid seek table. The 1.0.2 binary releases, except the Darwin release, do not have this problem, since they are built with Ogg support. This bug has been fixed in CVS. This will not affect the integrity of the audio data, but may increase the seek time during playback. You can use <B><TT>metaflac</TT></B> to verify the integrity of existing files' seek tables.
There are no known bugs.
</LI>
</P>
</FONT>
......@@ -1059,7 +1076,7 @@
</UL>
</P>
<P>
If you like this little hack, make sure to <A HREF="mailto:email@monkeysaudio.com">ask Matt</A> (the author) to add FLAC support officially! Also, other front-ends may be wedged in the same way; if you have one in mind, post it to the flac-dev mailing list.
Other front-ends may be wedged in the same way; if you have one in mind, post it to the flac-dev mailing list.
</P>
</FONT>
</TD></TR>
......
......@@ -111,8 +111,9 @@
<LI>
<B>Windows</B>
<UL>
<LI>There is a Windows GUI appropriately called <A HREF="http://home.wanadoo.nl/~w.speek/flac.htm">FLAC frontend</A>.</LI>
<LI><A HREF="http://www.monkeysaudio.com/">Monkey's Audio</A> can be fooled into supporting FLAC as an external encoder; <A HREF="documentation.html#monkey">here's how</A>. If you like it, be sure to ask Matt to add support for FLAC officially!</LI>
<LI><A HREF="http://home.wanadoo.nl/~w.speek/flac.htm">FLAC frontend</A>, a Windows GUI.</LI>
<LI><A HREF="http://www.inf.ufpr.br/~rja00/lossless.html">FLACdrop</A>, an Oggdrop-like frontend for Windows.</LI>
<LI><A HREF="http://www.monkeysaudio.com/">Monkey's Audio</A> can be fooled into supporting FLAC as an external encoder; <A HREF="documentation.html#monkey">here's how</A>.</LI>
</UL>
</LI>
<LI>
......
......@@ -82,13 +82,14 @@
<P>
<UL>
<LI>the stream format</LI>
<LI>libFLAC, a library which implements reference encoders and decoders</LI>
<LI><B><TT>libFLAC</TT></B>, a library of reference encoders and decoders, and a metadata interface</LI>
<LI><B><TT>libFLAC++</TT></B>, an object wrapper around libFLAC</LI>
<LI><B><TT>flac</TT></B>, a command-line wrapper around libFLAC to encode and decode .flac files</LI>
<LI>input plugins for various music players (Winamp, XMMS, and more in the works)</LI>
</UL>
</P>
<P>
"Free" means that the specification of the stream format is in the public domain (the FLAC project reserves the right to set the FLAC specification and certify compliance), and that neither the FLAC format nor any of the implemented encoding/decoding methods are covered by any patent. It also means that the source for libFLAC is available under the <A HREF="http://www.opensource.org/licenses/lgpl-license.html">LGPL</A> and the sources for <B><TT>flac</TT></B> and the plugins are available under the <A HREF="http://www.opensource.org/licenses/gpl-license.html">GPL</A>.
"Free" means that the specification of the stream format is in the public domain (the FLAC project reserves the right to set the FLAC specification and certify compliance), and that neither the FLAC format nor any of the implemented encoding/decoding methods are covered by any patent. It also means that the sources for <B><TT>libFLAC</TT></B> and <B><TT>libFLAC++</TT></B> are available under the <A HREF="http://www.opensource.org/licenses/lgpl-license.html">LGPL</A> and the sources for <B><TT>flac</TT></B> and the plugins are available under the <A HREF="http://www.opensource.org/licenses/gpl-license.html">GPL</A>.
</P>
<P>
FLAC compiles on many platforms: most Unixes (Linux, *BSD, Solaris, OS X), Windows, BeOS, and OS/2. There are build systems for autoconf/automake, MSVC, Watcom C, and Project Builder.
......
......@@ -106,13 +106,14 @@
<P>
<UL>
<LI>the stream format</LI>
<LI><B><TT>libFLAC</TT></B>, which implements reference encoders and decoders</LI>
<LI><B><TT>libFLAC</TT></B>, a library of reference encoders and decoders, and a metadata interface</LI>
<LI><B><TT>libFLAC++</TT></B>, an object wrapper around libFLAC</LI>
<LI><B><TT>flac</TT></B>, a command-line wrapper around libFLAC to encode and decode .flac files</LI>
<LI>input plugins for various music players (Winamp, XMMS, and more in the works)</LI>
</UL>
</P>
<P>
"Free" means that the specification of the stream format is in the public domain (the FLAC project reserves the right to set the FLAC specification and certify compliance), and that neither the FLAC format nor any of the implemented encoding/decoding methods are covered by any patent. It also means that the source for libFLAC is available under the <A HREF="http://www.opensource.org/licenses/lgpl-license.html">LGPL</A> and the sources for flac and the plugins are available under the <A HREF="http://www.opensource.org/licenses/gpl-license.html">GPL</A>.
"Free" means that the specification of the stream format is in the public domain (the FLAC project reserves the right to set the FLAC specification and certify compliance), and that neither the FLAC format nor any of the implemented encoding/decoding methods are covered by any patent. It also means that the sources for <B><TT>libFLAC</TT></B> and <B><TT>libFLAC++</TT></B> are available under the <A HREF="http://www.opensource.org/licenses/lgpl-license.html">LGPL</A> and the sources for <B><TT>flac</TT></B> and the plugins are available under the <A HREF="http://www.opensource.org/licenses/gpl-license.html">GPL</A>.
</P>
<P>
FLAC compiles on many platforms: most Unixes (Linux, *BSD, Solaris, OS X), Windows, BeOS, and OS/2. There are build systems for autoconf/automake, MSVC, Watcom C, and Project Builder.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment