* Bug 15978 fixed [sound]: wavwrite (en) page. savewave: + mclose() < errors
[scilab.git] / scilab / modules / sound / help / en_US / wavwrite.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) ????-2006 - INRIA - Scilab
5  *
6  * Copyright (C) 2012 - 2016 - Scilab Enterprises
7  *
8  * This file is hereby licensed under the terms of the GNU GPL v2.0,
9  * pursuant to article 5.3.4 of the CeCILL v.2.1.
10  * This file was originally licensed under the terms of the CeCILL v2.1,
11  * and continues to be available under such terms.
12  * For more information, see the COPYING file which you should have received
13  * along with this program.
14  *
15 -->
16 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
17           xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml"
18           xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
19           xmlns:scilab="http://www.scilab.org" xml:id="wavwrite" xml:lang="en">
20     <refnamediv>
21         <refname>wavwrite</refname>
22         <refpurpose>writes .wav sound file</refpurpose>
23     </refnamediv>
24     <refsynopsisdiv>
25         <title>Syntax</title>
26         <synopsis>
27             wavwrite(y, wavfile)
28             wavwrite(y, Fs, wavfile)
29             wavwrite(y, Fs, nbits, wavfile)
30         </synopsis>
31     </refsynopsisdiv>
32     <refsection>
33         <title>Arguments</title>
34         <variablelist>
35             <varlistentry>
36                 <term>y</term>
37                 <listitem>
38                     <para>row vector or matrix: Sound amplitudes = real values in [-1,1].
39                         One row per channel. Values out of [-1,+1] are ignored.
40                     </para>
41                 </listitem>
42             </varlistentry>
43             <varlistentry>
44                 <term>wavfile</term>
45                 <listitem>
46                     <para>string (The .wav extension is appended if no extension is given)
47                     </para>
48                 </listitem>
49             </varlistentry>
50             <varlistentry>
51                 <term>Fs</term>
52                 <listitem>
53                     <para>integer: Sampling frequency, in Hz. 22500 is the default value.</para>
54                 </listitem>
55             </varlistentry>
56             <varlistentry>
57                 <term>nbits</term>
58                 <listitem>
59                     <para>bit-depth 8, 16, 24, 32 bits. it describes the number of bits of
60                           information recorded for each sample. 16 is the default value.
61                     </para>
62                 </listitem>
63             </varlistentry>
64         </variablelist>
65     </refsection>
66     <refsection>
67         <title>Description</title>
68         <para>
69             Utility function to save <literal>.wav</literal> sound file.
70             <literal>wavwrite(y,wavfile)</literal> writes a sound file specified by
71             the string <literal>wavfile</literal>.
72         </para>
73         <para>
74             <literal>wavwrite(y,Fs,wavfile)</literal> specifies in
75             <literal>Fs</literal> the sampling rate of the data in Hertz.
76         </para>
77     </refsection>
78     <refsection>
79         <title>Examples</title>
80         <programlisting role="example"><![CDATA[
81 A = matrix(1:6,2,3);
82 wavwrite(A/6,TMPDIR+'/foo.wav');
83 B = wavread(TMPDIR+'/foo.wav');
84  ]]></programlisting>
85     </refsection>
86     <refsection role="see also">
87         <title>See also</title>
88         <simplelist type="inline">
89             <member>
90                 <link linkend="auread">auread</link>
91             </member>
92             <member>
93                 <link linkend="wavread">wavread</link>
94             </member>
95             <member>
96                 <link linkend="savewave">savewave</link>
97             </member>
98             <member>
99                 <link linkend="analyze">analyze</link>
100             </member>
101             <member>
102                 <link linkend="mapsound">mapsound</link>
103             </member>
104         </simplelist>
105     </refsection>
106 </refentry>