Files
stk/doc/html/classWvOut.html
2013-09-29 23:37:27 +02:00

440 lines
19 KiB
HTML

<HTML>
<HEAD>
<TITLE>The Synthesis ToolKit in C++ (STK)</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<img src="princeton.gif"> &nbsp; <img src="ccrma.gif"> &nbsp; <img src="mcgill.gif"><P>
<a class="qindex" href="index.html">Home</a> &nbsp; <a class="qindex" href="information.html">Information</a> &nbsp; <a class="qindex" href="classes.html">Classes</a> &nbsp; <a class="qindex" href="download.html">Download</a> &nbsp; <a class="qindex" href="usage.html">Usage</a> &nbsp; <a class="qindex" href="maillist.html">Mail List</a> &nbsp; <a class="qindex" href="system.html">Requirements</a> &nbsp; <a class="qindex" href="links.html">Links</a> &nbsp; <a class="qindex" href="tutorial.html">Tutorial</a></CENTER>
<HR>
<!-- Generated by Doxygen 1.3.6 -->
<h1>WvOut Class Reference</h1>STK audio data output base class.
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="WvOut_8h-source.html">WvOut.h</a>&gt;</code>
<p>
<p>Inheritance diagram for WvOut:
<p><center><img src="classWvOut.png" usemap="#WvOut_map" border="0" alt=""></center>
<map name="WvOut_map">
<area href="classStk.html" alt="Stk" shape="rect" coords="40,0,111,24">
<area href="classRtWvOut.html" alt="RtWvOut" shape="rect" coords="0,112,71,136">
<area href="classTcpWvOut.html" alt="TcpWvOut" shape="rect" coords="81,112,152,136">
</map>
<a href="classWvOut-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a0" doxytag="WvOut::WvOut" ></a>
&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classWvOut.html#a0">WvOut</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Default constructor. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classWvOut.html#a1">WvOut</a> (const char *fileName, unsigned int nChannels=1, FILE_TYPE type=<a class="el" href="classWvOut.html#s1">WVOUT_WAV</a>, Stk::STK_FORMAT format=<a class="el" href="classStk.html#s1">STK_SINT16</a>)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Overloaded constructor used to specify a file name, type, and data format with this object. <a href="#a1"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a2" doxytag="WvOut::~WvOut" ></a>
virtual&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classWvOut.html#a2">~WvOut</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Class destructor. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classWvOut.html#a3">openFile</a> (const char *fileName, unsigned int nChannels=1, WvOut::FILE_TYPE type=<a class="el" href="classWvOut.html#s1">WVOUT_WAV</a>, Stk::STK_FORMAT format=<a class="el" href="classStk.html#s1">STK_SINT16</a>)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a file of the specified type and name and output samples to it in the given data format. <a href="#a3"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a4" doxytag="WvOut::closeFile" ></a>
void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classWvOut.html#a4">closeFile</a> (void)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">If a file is open, write out samples in the queue and then close it. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a5" doxytag="WvOut::getFrames" ></a>
unsigned long&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classWvOut.html#a5">getFrames</a> (void) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the number of sample frames output. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a6" doxytag="WvOut::getTime" ></a>
MY_FLOAT&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classWvOut.html#a6">getTime</a> (void) const </td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return the number of seconds of data output. <br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classWvOut.html#a7">tick</a> (const MY_FLOAT sample)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Output a single sample to all channels in a sample frame. <a href="#a7"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classWvOut.html#a8">tick</a> (const MY_FLOAT *vector, unsigned int vectorSize)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Output each sample in <em>vector</em> to all channels in <em>vectorSize</em> sample frames. <a href="#a8"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classWvOut.html#a9">tickFrame</a> (const MY_FLOAT *frameVector, unsigned int frames=1)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Output the <em>frameVector</em> of sample frames of the given length. <a href="#a9"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Static Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>const FILE_TYPE&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classWvOut.html#s0">WVOUT_RAW</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>const FILE_TYPE&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classWvOut.html#s1">WVOUT_WAV</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>const FILE_TYPE&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classWvOut.html#s2">WVOUT_SND</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>const FILE_TYPE&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classWvOut.html#s3">WVOUT_AIF</a></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>const FILE_TYPE&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classWvOut.html#s4">WVOUT_MAT</a></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
STK audio data output base class.
<p>
This class provides output support for various audio file formats. It also serves as a base class for "realtime" streaming subclasses.<p>
WvOut writes samples to an audio file. It supports multi-channel data in interleaved format. It is important to distinguish the <a class="el" href="classWvOut.html#a7">tick()</a> methods, which output single samples to all channels in a sample frame, from the <a class="el" href="classWvOut.html#a9">tickFrame()</a> method, which takes a pointer to multi-channel sample frame data.<p>
WvOut currently supports WAV, AIFF, AIFC, SND (AU), MAT-file (Matlab), and STK RAW file formats. Signed integer (8-, 16-, and 32-bit) and floating- point (32- and 64-bit) data types are supported. STK RAW files use 16-bit integers by definition. MAT-files will always be written as 64-bit floats. If a data type specification does not match the specified file type, the data type will automatically be modified. Uncompressed data types are not supported.<p>
Currently, WvOut is non-interpolating and the output rate is always <a class="el" href="classStk.html#e0">Stk::sampleRate()</a>.<p>
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
<p>
<p>
Definition at line <a class="el" href="WvOut_8h-source.html#l00044">44</a> of file <a class="el" href="WvOut_8h-source.html">WvOut.h</a>.<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="a1" doxytag="WvOut::WvOut" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> WvOut::WvOut </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const char *&nbsp;</td>
<td class="mdname" nowrap> <em>fileName</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>nChannels</em> = 1, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>FILE_TYPE&nbsp;</td>
<td class="mdname" nowrap> <em>type</em> = <a class="el" href="classWvOut.html#s1">WVOUT_WAV</a>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>Stk::STK_FORMAT&nbsp;</td>
<td class="mdname" nowrap> <em>format</em> = <a class="el" href="classStk.html#s1">STK_SINT16</a></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Overloaded constructor used to specify a file name, type, and data format with this object.
<p>
An <a class="el" href="classStkError.html">StkError</a> is thrown for invalid argument values or if an error occurs when initializing the output file. </td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a3" doxytag="WvOut::openFile" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void WvOut::openFile </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const char *&nbsp;</td>
<td class="mdname" nowrap> <em>fileName</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>nChannels</em> = 1, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>WvOut::FILE_TYPE&nbsp;</td>
<td class="mdname" nowrap> <em>type</em> = <a class="el" href="classWvOut.html#s1">WVOUT_WAV</a>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>Stk::STK_FORMAT&nbsp;</td>
<td class="mdname" nowrap> <em>format</em> = <a class="el" href="classStk.html#s1">STK_SINT16</a></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Create a file of the specified type and name and output samples to it in the given data format.
<p>
An <a class="el" href="classStkError.html">StkError</a> is thrown for invalid argument values or if an error occurs when initializing the output file. </td>
</tr>
</table>
<a class="anchor" name="a7" doxytag="WvOut::tick" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> virtual void WvOut::tick </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const MY_FLOAT&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>sample</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Output a single sample to all channels in a sample frame.
<p>
An <a class="el" href="classStkError.html">StkError</a> is thrown if a file write error occurs.
<p>
Reimplemented in <a class="el" href="classRtWvOut.html#a6">RtWvOut</a>, and <a class="el" href="classTcpWvOut.html#a7">TcpWvOut</a>. </td>
</tr>
</table>
<a class="anchor" name="a8" doxytag="WvOut::tick" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> virtual void WvOut::tick </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const MY_FLOAT *&nbsp;</td>
<td class="mdname" nowrap> <em>vector</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>vectorSize</em></td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Output each sample in <em>vector</em> to all channels in <em>vectorSize</em> sample frames.
<p>
An <a class="el" href="classStkError.html">StkError</a> is thrown if a file write error occurs.
<p>
Reimplemented in <a class="el" href="classRtWvOut.html#a7">RtWvOut</a>, and <a class="el" href="classTcpWvOut.html#a8">TcpWvOut</a>. </td>
</tr>
</table>
<a class="anchor" name="a9" doxytag="WvOut::tickFrame" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> virtual void WvOut::tickFrame </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const MY_FLOAT *&nbsp;</td>
<td class="mdname" nowrap> <em>frameVector</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td></td>
<td class="md" nowrap>unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>frames</em> = 1</td>
</tr>
<tr>
<td></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Output the <em>frameVector</em> of sample frames of the given length.
<p>
An <a class="el" href="classStkError.html">StkError</a> is thrown if a file write error occurs.
<p>
Reimplemented in <a class="el" href="classRtWvOut.html#a8">RtWvOut</a>, and <a class="el" href="classTcpWvOut.html#a9">TcpWvOut</a>. </td>
</tr>
</table>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="s0" doxytag="WvOut::WVOUT_RAW" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> const FILE_TYPE <a class="el" href="classWvOut.html#s0">WvOut::WVOUT_RAW</a><code> [static]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
STK RAW file type.
<p>
Definition at line <a class="el" href="WvOut_8h-source.html#l00050">50</a> of file <a class="el" href="WvOut_8h-source.html">WvOut.h</a>. </td>
</tr>
</table>
<a class="anchor" name="s1" doxytag="WvOut::WVOUT_WAV" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> const FILE_TYPE <a class="el" href="classWvOut.html#s1">WvOut::WVOUT_WAV</a><code> [static]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
WAV file type.
<p>
Definition at line <a class="el" href="WvOut_8h-source.html#l00051">51</a> of file <a class="el" href="WvOut_8h-source.html">WvOut.h</a>. </td>
</tr>
</table>
<a class="anchor" name="s2" doxytag="WvOut::WVOUT_SND" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> const FILE_TYPE <a class="el" href="classWvOut.html#s2">WvOut::WVOUT_SND</a><code> [static]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
SND (AU) file type.
<p>
Definition at line <a class="el" href="WvOut_8h-source.html#l00052">52</a> of file <a class="el" href="WvOut_8h-source.html">WvOut.h</a>. </td>
</tr>
</table>
<a class="anchor" name="s3" doxytag="WvOut::WVOUT_AIF" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> const FILE_TYPE <a class="el" href="classWvOut.html#s3">WvOut::WVOUT_AIF</a><code> [static]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
AIFF file type.
<p>
Definition at line <a class="el" href="WvOut_8h-source.html#l00053">53</a> of file <a class="el" href="WvOut_8h-source.html">WvOut.h</a>. </td>
</tr>
</table>
<a class="anchor" name="s4" doxytag="WvOut::WVOUT_MAT" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> const FILE_TYPE <a class="el" href="classWvOut.html#s4">WvOut::WVOUT_MAT</a><code> [static]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
&nbsp;
</td>
<td>
<p>
Matlab MAT-file type.
<p>
Definition at line <a class="el" href="WvOut_8h-source.html#l00054">54</a> of file <a class="el" href="WvOut_8h-source.html">WvOut.h</a>. </td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="WvOut_8h-source.html">WvOut.h</a></ul>
<HR>
<table>
<tr><td><A HREF="http://www-ccrma.stanford.edu/software/stk/"><I>The Synthesis ToolKit in C++ (STK)</I></A></td></tr>
<tr><td>&copy;1995-2004 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
</table>
</BODY>
</HTML>