<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
<MAN>
  <LANGUAGE>eng</LANGUAGE>
  <TITLE>wavwrite</TITLE>
  <TYPE>Scilab Function</TYPE>
  <DATE>April 1993</DATE>
  <SHORT_DESCRIPTION name="wavwrite"> writes .wav sound file</SHORT_DESCRIPTION>
  <CALLING_SEQUENCE>
    <CALLING_SEQUENCE_ITEM>wavwrite(y,wavfile)  </CALLING_SEQUENCE_ITEM>
    <CALLING_SEQUENCE_ITEM>wavwrite(y,Fs,wavfile)  </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>wavfile</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: string (The .wav 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_INDENT>
  </PARAM>
  <DESCRIPTION>
    <P>
    Utility function to save <VERB>.wav</VERB> sound file.
    <VERB>wavwrite(y,wavfile)</VERB> writes a sound file specified by the
    string wavfile.  The data should be arranged with one channel
    per column.  Amplitude values outside the range [-1,+1] are
    ignored.
    </P>
    <P><VERB>wavwrite(y,Fs,wavfile)</VERB> specifies in <VERB>Fs</VERB> the sample rate of the data
    in Hertz.</P>
  </DESCRIPTION>
  <EXAMPLE>
<![CDATA[
  A=matrix(1:6,2,3);
  wavwrite(A/6,TMPDIR+'/foo.wav');
  B=wavread(TMPDIR+'/foo.wav');
  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>
