<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
  <!ENTITY % general-entities SYSTEM "../../general.ent">
  %general-entities;

  <!ENTITY faad2-download-http "&sourceforge-repo;/faac/faad2-&faad2-version;.tar.bz2">
  <!ENTITY faad2-download-ftp  " ">
  <!ENTITY faad2-md5sum        "4c332fa23febc0e4648064685a3d4332">
  <!ENTITY faad2-size          "880 KB">
  <!ENTITY faad2-buildsize     "12 MB (without media player plugins)">
  <!ENTITY faad2-time          "0.2 SBU (without media player plugins)">
]>

<sect1 id="faad2" xreflabel="FAAD2-&faad2-version;">
  <?dbhtml filename="faad2.html"?>

  <sect1info>
    <othername>$LastChangedBy: bdubbs $</othername>
    <date>$Date: 2015-02-24 00:00:51 -0500 (Tue, 24 Feb 2015) $</date>
  </sect1info>

  <title>FAAD2-&faad2-version;</title>

  <indexterm zone="faad2">
    <primary sortas="a-faad2">faad2</primary>
  </indexterm>

  <sect2 role="package">
    <title>Introduction to FAAD2</title>

    <para><application>FAAD2</application> is a decoder for a lossy sound
    compression scheme specified in MPEG-2 Part 7 and MPEG-4 Part 3 standards
    and known as Advanced Audio Coding (AAC).</para>

    &lfs77_checked;

    <bridgehead renderas="sect3">Package Information</bridgehead>
    <itemizedlist spacing="compact">
      <listitem>
        <para>Download (HTTP): <ulink url="&faad2-download-http;"/></para>
      </listitem>
      <listitem>
        <para>Download (FTP): <ulink url="&faad2-download-ftp;"/></para>
      </listitem>
      <listitem>
        <para>Download MD5 sum: &faad2-md5sum;</para>
      </listitem>
      <listitem>
        <para>Download size: &faad2-size;</para>
      </listitem>
      <listitem>
        <para>Estimated disk space required: &faad2-buildsize;</para>
      </listitem>
      <listitem>
        <para>Estimated build time: &faad2-time;</para>
      </listitem>
    </itemizedlist>

    <bridgehead renderas="sect3">Additional Downloads</bridgehead>
    <itemizedlist spacing="compact">
      <listitem>
        <para>
          Required patch: <ulink url="&patch-root;/faad2-&faad2-version;-mp4ff-1.patch"/>
        </para>
      </listitem>
      <listitem>
        <para>
          Sample AAC file: <ulink url="http://www.nch.com.au/acm/sample.aac"/> (7 KB)
        </para>
      </listitem>
    </itemizedlist>

    <!--
    <bridgehead renderas="sect3">FAAD2 Dependencies</bridgehead>

    <bridgehead renderas="sect4">Optional (to build corresponding AAC plugins)</bridgehead>
    <para role="optional"><xref linkend="xmms"/> and
    <ulink url="http://mpeg4ip.sourceforge.net/">mpeg4ip</ulink> (both
    are untested, and both projects are dead).</para> -->

    <para condition="html" role="usernotes">User Notes:
    <ulink url="&blfs-wiki;/faad2"/></para>

  </sect2>

  <sect2 role="installation">
    <title>Installation of FAAD2</title>

    <para>Install <application>FAAD2</application> by running the
    following commands:</para>

<screen><userinput>patch -Np1 -i ../faad2-&faad2-version;-mp4ff-1.patch &amp;&amp;
sed -i "s:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:g" configure.in &amp;&amp;
sed -i "s:man_MANS:man1_MANS:g" frontend/Makefile.am &amp;&amp;
autoreconf -fi &amp;&amp;
./configure --prefix=/usr --disable-static &amp;&amp;
make</userinput></screen>

    <para>This package does not come with a test suite. However, basic
    functionality can be tested by decoding the sample AAC file:</para>

<screen><userinput>./frontend/faad -o sample.wav ../sample.aac</userinput></screen>

    <para>This should display a copyright message and the following
    information about the sample file:</para>

<literallayout><computeroutput>sample.aac file info:
ADTS, 4.608 sec, 13 kbps, 16000 Hz

  ---------------------
 | Config:  2 Ch       |
  ---------------------
 | Ch |    Position    |
  ---------------------
 | 00 | Left front     |
 | 01 | Right front    |
  ---------------------</computeroutput></literallayout>

    <para>Now play the result (requires the <command>aplay</command> program
    from the <xref linkend="alsa-utils"/> package):</para>

<screen><userinput>aplay sample.wav</userinput></screen>

    <para><command>aplay</command> should identify the file as
    <quote>Signed 16 bit Little Endian, Rate 16000 Hz, Stereo</quote>, and you
    should hear some piano notes.</para>

    <para>Now, as the <systemitem class="username">root</systemitem> user:</para>

<screen role="root"><userinput>make install</userinput></screen>

  </sect2>

  <sect2 role="commands">
    <title>Command Explanations</title>

    <!-- <para><command>./bootstrap</command>: This command runs GNU Autotools
    to create the <command>configure</command> script and other
    required build files.</para> -->

    <para>
      <command>sed -i ...</command>: First command fixes autotools scripts to
      be compatible with latest version of <application>Automake</application>
      and second command fixes manual page install location.
    </para>

    <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
      href="../../xincludes/static-libraries.xml"/>

    <para><option>--with-drm</option>: This option is supposed to enable
    support for decoding
    <ulink url="http://www.drm.org/">Digital Radio Mondiale</ulink>, but
    actually breaks the base functionality of the package (e.g., the resulting
    <command>faad</command> program cannot decode the sample AAC file
    linked above). Don't use it.</para>
  </sect2>

  <sect2 role="content">
    <title>Contents</title>

    <segmentedlist>
      <segtitle>Installed Program</segtitle>
      <segtitle>Installed Library</segtitle>
      <segtitle>Installed Directories</segtitle>

      <seglistitem>
        <seg>faad</seg>
        <seg>libfaad.so</seg>
        <seg>None</seg>
      </seglistitem>
    </segmentedlist>

    <variablelist>
      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
      <?dbfo list-presentation="list"?>
      <?dbhtml list-presentation="table"?>

      <varlistentry id="faad-prog">
        <term><command>faad</command></term>
        <listitem>
          <para>is a command-line utility for decoding AAC and MP4 files.</para>
          <indexterm zone="faad2 faad-prog">
            <primary sortas="b-faad">faad</primary>
          </indexterm>
        </listitem>
      </varlistentry>

      <varlistentry id="libfaad">
        <term><filename class='libraryfile'>libfaad.so</filename></term>
        <listitem>
          <para>contains functions for decoding AAC streams.</para>
          <indexterm zone="faad2 libfaad">
            <primary sortas="c-libfaad">libfaad.so</primary>
          </indexterm>
        </listitem>
      </varlistentry>

    </variablelist>

  </sect2>

</sect1>
