mirror of
https://github.com/thestk/stk
synced 2026-01-13 21:11:53 +00:00
424 lines
15 KiB
HTML
424 lines
15 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"> <img src="ccrma.gif"><P>
|
|
<a class="qindex" href="index.html">Home</a> <a class="qindex" href="information.html">Information</a> <a class="qindex" href="classes.html">Classes</a> <a class="qindex" href="download.html">Download</a> <a class="qindex" href="usage.html">Usage</a> <a class="qindex" href="maillist.html">Mail List</a> <a class="qindex" href="system.html">Requirements</a> <a class="qindex" href="tutorial.html">Tutorial</a></CENTER>
|
|
<HR>
|
|
<!-- Generated by Doxygen 1.2.8.1 -->
|
|
<h1>WvOut Class Reference</h1>STK audio data output base class.
|
|
<a href="#_details">More...</a>
|
|
<p>
|
|
<code>#include <<a class="el" href="WvOut_8h-source.html">WvOut.h</a>></code>
|
|
<p>
|
|
<p>Inheritance diagram for WvOut::
|
|
<p><center><img src="classWvOut.gif" usemap="#WvOut_map" border="0"></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 colspan=2><br><h2>Public Methods</h2></td></tr>
|
|
<tr><td nowrap align=right valign=top><a name="a0" doxytag="WvOut::WvOut"></a>
|
|
</td><td valign=bottom><a class="el" href="classWvOut.html#a0">WvOut</a> ()</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Default constructor.</em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top> </td><td 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#p1">WVOUT_WAV</a>, Stk::STK_FORMAT format=<a class="el" href="classStk.html#p1">STK_SINT16</a>)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Overloaded constructor used to specify a file name, type, and data format with this object.</em> <a href="#a1">More...</a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top><a name="a2" doxytag="WvOut::~WvOut"></a>
|
|
virtual </td><td valign=bottom><a class="el" href="classWvOut.html#a2">~WvOut</a> ()</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Class destructor.</em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>void </td><td 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#p1">WVOUT_WAV</a>, Stk::STK_FORMAT format=<a class="el" href="classStk.html#p1">STK_SINT16</a>)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Create a file of the specified type and name and output samples to it in the given data format.</em> <a href="#a3">More...</a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top><a name="a4" doxytag="WvOut::closeFile"></a>
|
|
void </td><td valign=bottom><a class="el" href="classWvOut.html#a4">closeFile</a> (void)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>If a file is open, write out samples in the queue and then close it.</em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top><a name="a5" doxytag="WvOut::getFrames"></a>
|
|
unsigned long </td><td valign=bottom><a class="el" href="classWvOut.html#a5">getFrames</a> (void) const</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Return the number of sample frames output.</em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top><a name="a6" doxytag="WvOut::getTime"></a>
|
|
MY_FLOAT </td><td valign=bottom><a class="el" href="classWvOut.html#a6">getTime</a> (void) const</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Return the number of seconds of data output.</em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classWvOut.html#a7">tick</a> (const MY_FLOAT sample)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Output a single sample to all channels in a sample frame.</em> <a href="#a7">More...</a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classWvOut.html#a8">tick</a> (const MY_FLOAT *vector, unsigned int vectorSize)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Output each sample in <em>vector</em> to all channels in <em>vectorSize</em> sample frames.</em> <a href="#a8">More...</a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classWvOut.html#a9">tickFrame</a> (const MY_FLOAT *frameVector, unsigned int frames=1)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Output the <em>frameVector</em> of sample frames of the given length.</em> <a href="#a9">More...</a><em></em></font><br><br></td></tr>
|
|
<tr><td colspan=2><br><h2>Static Public Attributes</h2></td></tr>
|
|
<tr><td nowrap align=right valign=top>const FILE_TYPE </td><td valign=bottom><a class="el" href="classWvOut.html#p0">WVOUT_RAW</a></td></tr>
|
|
<tr><td nowrap align=right valign=top>const FILE_TYPE </td><td valign=bottom><a class="el" href="classWvOut.html#p1">WVOUT_WAV</a></td></tr>
|
|
<tr><td nowrap align=right valign=top>const FILE_TYPE </td><td valign=bottom><a class="el" href="classWvOut.html#p2">WVOUT_SND</a></td></tr>
|
|
<tr><td nowrap align=right valign=top>const FILE_TYPE </td><td valign=bottom><a class="el" href="classWvOut.html#p3">WVOUT_AIF</a></td></tr>
|
|
<tr><td nowrap align=right valign=top>const FILE_TYPE </td><td valign=bottom><a class="el" href="classWvOut.html#p4">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#d0">Stk::sampleRate</a>().
|
|
<p>
|
|
by Perry R. Cook and Gary P. Scavone, 1995 - 2002.
|
|
<p>
|
|
<hr><h2>Constructor & Destructor Documentation</h2>
|
|
<a name="a1" doxytag="WvOut::WvOut"></a><p>
|
|
<table width="100%" cellpadding="2" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td nowrap valign="top"><b>
|
|
WvOut::WvOut (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
const char * <em>fileName</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
unsigned int <em>nChannels</em> = 1,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
FILE_TYPE <em>type</em> = <a class="el" href="classWvOut.html#p1">WVOUT_WAV</a>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
Stk::STK_FORMAT <em>format</em> = <a class="el" href="classStk.html#p1">STK_SINT16</a> )
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</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 name="a3" doxytag="WvOut::openFile"></a><p>
|
|
<table width="100%" cellpadding="2" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td nowrap valign="top"><b>
|
|
void WvOut::openFile (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
const char * <em>fileName</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
unsigned int <em>nChannels</em> = 1,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
WvOut::FILE_TYPE <em>type</em> = <a class="el" href="classWvOut.html#p1">WVOUT_WAV</a>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
Stk::STK_FORMAT <em>format</em> = <a class="el" href="classStk.html#p1">STK_SINT16</a> )
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</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 name="a7" doxytag="WvOut::tick"></a><p>
|
|
<table width="100%" cellpadding="2" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td nowrap valign="top"><b>
|
|
void WvOut::tick (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
const MY_FLOAT <em>sample</em> )<code> [virtual]</code>
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</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 read 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 name="a8" doxytag="WvOut::tick"></a><p>
|
|
<table width="100%" cellpadding="2" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td nowrap valign="top"><b>
|
|
void WvOut::tick (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
const MY_FLOAT * <em>vector</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
unsigned int <em>vectorSize</em> )<code> [virtual]</code>
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</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 read 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 name="a9" doxytag="WvOut::tickFrame"></a><p>
|
|
<table width="100%" cellpadding="2" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td nowrap valign="top"><b>
|
|
void WvOut::tickFrame (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
const MY_FLOAT * <em>frameVector</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
unsigned int <em>frames</em> = 1 )<code> [virtual]</code>
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</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 read 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 name="p0" doxytag="WvOut::WVOUT_RAW"></a><p>
|
|
<table width="100%" cellpadding="2" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td nowrap valign="top"><b>
|
|
const FILE_TYPE WvOut::WVOUT_RAW<code> [static]</code>
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
STK RAW file type. </td>
|
|
</tr>
|
|
</table>
|
|
<a name="p1" doxytag="WvOut::WVOUT_WAV"></a><p>
|
|
<table width="100%" cellpadding="2" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td nowrap valign="top"><b>
|
|
const FILE_TYPE WvOut::WVOUT_WAV<code> [static]</code>
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
WAV file type. </td>
|
|
</tr>
|
|
</table>
|
|
<a name="p2" doxytag="WvOut::WVOUT_SND"></a><p>
|
|
<table width="100%" cellpadding="2" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td nowrap valign="top"><b>
|
|
const FILE_TYPE WvOut::WVOUT_SND<code> [static]</code>
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
SND (AU) file type. </td>
|
|
</tr>
|
|
</table>
|
|
<a name="p3" doxytag="WvOut::WVOUT_AIF"></a><p>
|
|
<table width="100%" cellpadding="2" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td nowrap valign="top"><b>
|
|
const FILE_TYPE WvOut::WVOUT_AIF<code> [static]</code>
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
AIFF file type. </td>
|
|
</tr>
|
|
</table>
|
|
<a name="p4" doxytag="WvOut::WVOUT_MAT"></a><p>
|
|
<table width="100%" cellpadding="2" cellspacing="0" border="0">
|
|
<tr>
|
|
<td class="md">
|
|
<table cellpadding="0" cellspacing="0" border="0">
|
|
<tr>
|
|
<td nowrap valign="top"><b>
|
|
const FILE_TYPE WvOut::WVOUT_MAT<code> [static]</code>
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Matlab MAT-file type. </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>©1995-2002 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
|
</table>
|
|
|
|
</BODY>
|
|
</HTML>
|