<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
<MAN>
  <LANGUAGE>eng</LANGUAGE>
  <TITLE>wavread</TITLE>
  <TYPE>Scilab Function</TYPE>
  <DATE>April 1993</DATE>
  <SHORT_DESCRIPTION name="wavread"> load .wav sound file</SHORT_DESCRIPTION>
  <CALLING_SEQUENCE>
    <CALLING_SEQUENCE_ITEM>y=wavread(wavfile)  </CALLING_SEQUENCE_ITEM>
    <CALLING_SEQUENCE_ITEM>y=wavread(wavfile,ext)  </CALLING_SEQUENCE_ITEM>
    <CALLING_SEQUENCE_ITEM>[y,Fs,bits]=wavread(wavfile)  </CALLING_SEQUENCE_ITEM>
    <CALLING_SEQUENCE_ITEM>[y,Fs,bits]=wavread(wavfile,ext)  </CALLING_SEQUENCE_ITEM>
  </CALLING_SEQUENCE>
  <PARAM>
    <PARAM_INDENT>
      <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_ITEM>
        <PARAM_NAME>ext</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: string (<VERB>'size'</VERB>) or integer (to read n samples) or 1 x 2 integer vector [n1,n2] (to read from n1 to n2).</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
    </PARAM_INDENT>
  </PARAM>
  <DESCRIPTION>
    <P>
    Utility function to read <VERB>.wav</VERB> sound file.
    <VERB>wavread(wavfile)</VERB> loads a sound file specified by the string wavfile,
    returning the sampled data in y. Amplitude values are in the range [-1,+1].
    Supports multi-channel data in the following formats:
    8-bit mu-law, 8-, 16-, and 32-bit linear, and floating point.</P>
    <P><VERB>[y,Fs,bits]=wavread(wavfile)</VERB> returns the sample rate (Fs) in Hertz
    and the number of bits per sample used to encode the data in the file.</P>
    <P><VERB>wavread(wavfile,n)</VERB> returns the first n samples from each channel.</P>
    <P><VERB>wavread(wavfile,[n1,n2])</VERB> returns samples n1 to n2.</P>
    <P><VERB>read(wavfile,'size')</VERB> returns the size of the audio data contained
    in the file in place of the actual audio data, returning the
    vector as [samples channels].</P>
  </DESCRIPTION>
  <EXAMPLE>
<![CDATA[
  wavread('SCI/demos/signal/sound/chimes.wav','size')

  [y,Fs,bits]=wavread('SCI/demos/signal/sound/chimes.wav');Fs,bits
  subplot(2,1,1)
  plot2d(y(:,1))
  subplot(2,1,2)
  plot2d(y(:,2))
  
  y=wavread('SCI/demos/signal/sound/chimes.wav',[1 5]) //the first five samples

 ]]>
  </EXAMPLE>
  <SEE_ALSO>
    <SEE_ALSO_ITEM>
      <LINK>auread</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>
