<!-- Converted to DocBook/SGML by Kevin Conder -->
<refentry id="filepeak">
  <refmeta>
    <refentrytitle>filepeak</refentrytitle>
  </refmeta>
 
  <refnamediv>
    <refname>filepeak</refname>
    <refpurpose>
      Returns the peak absolute value of a sound file.
      <indexterm id="IndexFilepeak"><primary>filepeak</primary></indexterm>
    </refpurpose>
  </refnamediv>
 
  <refsect1>
    <title>Description</title>
    <para>
      Returns the peak absolute value of a sound file.
    </para>
  </refsect1>
 
  <refsect1>
    <title>Syntax</title>
    <synopsis>ir <command>filepeak</command> ifilcod [, ichnl]</synopsis>
  </refsect1>
 
  <refsect1>
    <title>Initialization</title>
    <para>
      <emphasis>ifilcod</emphasis> -- sound file to be queried
    </para>

    <para>
      <emphasis>ichnl</emphasis> (optional, default=0) -- channel to be used in calculating the peak value. Default is 0.
      <itemizedlist>
        <listitem>
          <para><emphasis>ichnl</emphasis> = 0 returns peak value of all channels</para>
        </listitem>

        <listitem>
          <para><emphasis>ichnl</emphasis> &gt; 0 returns peak value of <emphasis>ichnl</emphasis></para>
        </listitem>
      </itemizedlist>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Performance</title>
    <para>
      <emphasis>filepeak</emphasis> returns the peak absolute value of the sound file <emphasis>ifilcod</emphasis>. Currently, <emphasis>filepeak</emphasis> supports only AIFF-C float files.
    </para>
  </refsect1>

  <refsect1>
    <title>Examples</title>
    <para>
      Here is an example of the filepeak opcode. It uses the files <ulink url="examples/filepeak.orc"><citetitle>filepeak.orc</citetitle></ulink>, <ulink url="examples/filepeak.sco"><citetitle>filepeak.sco</citetitle></ulink>,
and <ulink url="examples/mary.wav"><citetitle>mary.wav</citetitle></ulink>.

      <example>
        <title>Example of the filepeak opcode.</title>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/filepeak.orc" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>

        <programlisting>
<inlinemediaobject>
            <imageobject>
              <imagedata fileref="examples/filepeak.sco" format="linespecific">
            </imageobject>
          </inlinemediaobject>
        </programlisting>
      </example>

      The peak absolute value of the audio file <quote>mary.wav</quote> is 0.306902. So <emphasis>filepeak</emphasis>'s output should include a line like this:
      <screen>
instr 1:  ipeak = 0.307
      </screen>
    </para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para>
      <link linkend="filelen"><citetitle>filelen</citetitle></link>,
      <link linkend="filenchnls"><citetitle>filenchnls</citetitle></link>,
      <link linkend="filesr"><citetitle>filesr</citetitle></link>
    </para>
  </refsect1>
 
  <refsect1>
    <title>Credits</title>
    <para>
      <simplelist>
        <member>Author: &namematt;</member>
        <member>July 1999</member>
      </simplelist>
    </para>
    <para>Example written by &namekevin;.</para>

    <para>New in Csound version 3.57</para>
  </refsect1>
</refentry>
