fix online help examples
[scilab.git] / scilab / modules / sound / help / en_US / wavread.xml
1 <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
2 <!--
3     * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4     * Copyright (C) ????-2008 - INRIA - Scilab 
5     * 
6     * This file must be used under the terms of the CeCILL.
7     * This source file is licensed as described in the file COPYING, which
8     * you should have received as part of this distribution.  The terms
9     * are also available at    
10     * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
11     *
12     -->
13 <!DOCTYPE MAN SYSTEM "../../../../modules/helptools/help.dtd">
14 <MAN>
15   <LANGUAGE>eng</LANGUAGE>
16   <TITLE>wavread</TITLE>
17   <TYPE>Scilab Function</TYPE>
18   <DATE>$LastChangedDate$</DATE>
19   <SHORT_DESCRIPTION name="wavread"> load .wav sound file</SHORT_DESCRIPTION>
20   <CALLING_SEQUENCE>
21     <CALLING_SEQUENCE_ITEM>y=wavread(wavfile)  </CALLING_SEQUENCE_ITEM>
22     <CALLING_SEQUENCE_ITEM>y=wavread(wavfile,ext)  </CALLING_SEQUENCE_ITEM>
23     <CALLING_SEQUENCE_ITEM>[y,Fs,bits]=wavread(wavfile)  </CALLING_SEQUENCE_ITEM>
24     <CALLING_SEQUENCE_ITEM>[y,Fs,bits]=wavread(wavfile,ext)  </CALLING_SEQUENCE_ITEM>
25   </CALLING_SEQUENCE>
26   <PARAM>
27     <PARAM_INDENT>
28       <PARAM_ITEM>
29         <PARAM_NAME>wavfile</PARAM_NAME>
30         <PARAM_DESCRIPTION>
31           <SP>: string (The .wav extension is appended if no extension is given)</SP>
32         </PARAM_DESCRIPTION>
33       </PARAM_ITEM>
34       <PARAM_ITEM>
35         <PARAM_NAME>Fs</PARAM_NAME>
36         <PARAM_DESCRIPTION>
37           <SP>: integer, frequency sampling in Hz (number of samples per second).</SP>
38         </PARAM_DESCRIPTION>
39       </PARAM_ITEM>
40       <PARAM_ITEM>
41         <PARAM_NAME>ext</PARAM_NAME>
42         <PARAM_DESCRIPTION>
43           <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>
44         </PARAM_DESCRIPTION>
45       </PARAM_ITEM>
46     </PARAM_INDENT>
47   </PARAM>
48   <DESCRIPTION>
49     <P>
50     Utility function to read <VERB>.wav</VERB> sound file.
51     <VERB>wavread(wavfile)</VERB> loads a sound file specified by the string wavfile,
52     returning the sampled data in y. Amplitude values are in the range [-1,+1].
53     Supports multi-channel data in the following formats:
54     8-bit mu-law, 8-, 16-, and 32-bit linear, and floating point.</P>
55     <P><VERB>[y,Fs,bits]=wavread(wavfile)</VERB> returns the sample rate (Fs) in Hertz
56     and the number of bits per sample used to encode the data in the file.</P>
57     <P><VERB>wavread(wavfile,n)</VERB> returns the first n samples from each channel.</P>
58     <P><VERB>wavread(wavfile,[n1,n2])</VERB> returns samples n1 to n2.</P>
59     <P><VERB>read(wavfile,'size')</VERB> returns the size of the audio data contained
60     in the file in place of the actual audio data, returning the
61     vector as [samples channels].</P>
62   </DESCRIPTION>
63   <EXAMPLE>
64 <![CDATA[
65 wavread("SCI/modules/sound/demos/chimes.wav","size")
66 [y,Fs,bits]=wavread("SCI/modules/sound/demos/chimes.wav");Fs,bits
67 subplot(2,1,1)
68 plot2d(y(1,:)) // first channel 
69 subplot(2,1,2)
70 plot2d(y(2,:)) // second channel
71 y=wavread("SCI/modules/sound/demos/chimes.wav",[1 5]) //the first five samples
72 ]]>
73   </EXAMPLE>
74   <SEE_ALSO>
75     <SEE_ALSO_ITEM>
76       <LINK>auread</LINK>
77     </SEE_ALSO_ITEM>
78     <SEE_ALSO_ITEM>
79       <LINK>savewave</LINK>
80     </SEE_ALSO_ITEM>
81     <SEE_ALSO_ITEM>
82       <LINK>analyze</LINK>
83     </SEE_ALSO_ITEM>
84     <SEE_ALSO_ITEM>
85       <LINK>mapsound</LINK>
86     </SEE_ALSO_ITEM>
87   </SEE_ALSO>
88 </MAN>