<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
<MAN>
  <LANGUAGE>eng</LANGUAGE>
  <TITLE>auwrite</TITLE>
  <TYPE>Scilab Function</TYPE>
  <DATE>April 1993</DATE>
  <SHORT_DESCRIPTION name="auwrite"> writes .au sound file</SHORT_DESCRIPTION>
  <CALLING_SEQUENCE>
    <CALLING_SEQUENCE_ITEM>auwrite(y,aufile)  </CALLING_SEQUENCE_ITEM>
    <CALLING_SEQUENCE_ITEM>auwrite(y,Fs,aufile)  </CALLING_SEQUENCE_ITEM>
    <CALLING_SEQUENCE_ITEM>auwrite(y,Fs,bits,aufile)  </CALLING_SEQUENCE_ITEM>
    <CALLING_SEQUENCE_ITEM>auwrite(y,Fs,bits,method,aufile)  </CALLING_SEQUENCE_ITEM>
  </CALLING_SEQUENCE>
  <PARAM>
    <PARAM_INDENT>
      <PARAM_ITEM>
        <PARAM_NAME>y</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: real vector or matrix with entries in [-1,1].</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>aufile</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: string (The .au extension is appended if no extension is given)</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>Fs</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: integer, frequency sampling in Hz.</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>bits</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: integer, number of bits in the encoding.</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>method</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: string , <VERB>'mu'</VERB> (default) or <VERB>'linear'</VERB>, encoding method.</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
    </PARAM_INDENT>
  </PARAM>
  <DESCRIPTION>
    <P>
    Utility function to save <VERB>.au</VERB> sound file.
    <VERB>auwrite(y,aufile)</VERB> writes a sound file specified by the
    string aufile.  The data should be arranged with one channel
    per column.  Amplitude values outside the range [-1,+1] are
    ignored.
    Supports multi-channel data for 8-bit mu-law, and 8, 16, 32, 64 bits linear formats.</P>
    <P><VERB>auwrite(y,Fs,aufile)</VERB> specifies in <VERB>Fs</VERB> the sample rate of the data
    in Hertz.</P>
    <P><VERB>auwrite(y,Fs,bits,aufile)</VERB> selects the number of bits in
    the encoder. Allowable settings are bits in [8,16,32,64].
     
    <VERB>auwrite(y,Fs,bits,method,aufile)</VERB> allows selection of the
    encoding method, which can be either 'mu' or 'linear'.
    Note that bits must be 8 for 'mu' choice. The default method is 8-bits mu-law enconding.</P>
  </DESCRIPTION>
  <EXAMPLE>
<![CDATA[
  A=matrix(1:6,2,3);
  auwrite(A/6,22050,64,'linear',TMPDIR+'/foo.au');
  B=auread(TMPDIR+'/foo.au');
  maxi(abs(A- round(B*6)))
 ]]>
  </EXAMPLE>
  <SEE_ALSO>
    <SEE_ALSO_ITEM>
      <LINK>auread</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>wavread</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>savewave</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>analyze</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>mapsound</LINK>
    </SEE_ALSO_ITEM>
  </SEE_ALSO>
</MAN>
