mirror of
https://github.com/thestk/stk
synced 2026-01-12 12:31:53 +00:00
261 lines
15 KiB
HTML
261 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"> <img src="mcgill.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="links.html">Links</a> <a class="qindex" href="faq.html">FAQ</a> <a class="qindex" href="tutorial.html">Tutorial</a></CENTER>
|
|
<HR>
|
|
<!-- Generated by Doxygen 1.5.8 -->
|
|
<div class="navpath"><a class="el" href="namespacestk.html">stk</a>::<a class="el" href="classstk_1_1FileWvOut.html">FileWvOut</a>
|
|
</div>
|
|
<div class="contents">
|
|
<h1>stk::FileWvOut Class Reference</h1><!-- doxytag: class="stk::FileWvOut" --><!-- doxytag: inherits="stk::WvOut" -->STK audio file output class.
|
|
<a href="#_details">More...</a>
|
|
<p>
|
|
<code>#include <<a class="el" href="FileWvOut_8h-source.html">FileWvOut.h</a>></code>
|
|
<p>
|
|
<div class="dynheader">
|
|
Inheritance diagram for stk::FileWvOut:</div>
|
|
<div class="dynsection">
|
|
|
|
<p><center><img src="classstk_1_1FileWvOut.png" usemap="#stk::FileWvOut_map" border="0" alt=""></center>
|
|
<map name="stk::FileWvOut_map">
|
|
<area href="classstk_1_1WvOut.html" alt="stk::WvOut" shape="rect" coords="0,56,92,80">
|
|
<area href="classstk_1_1Stk.html" alt="stk::Stk" shape="rect" coords="0,0,92,24">
|
|
</map>
|
|
</div>
|
|
|
|
<p>
|
|
<a href="classstk_1_1FileWvOut-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"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileWvOut.html#6f0168fca20a3c9d6d5f2baedf03ec1b">FileWvOut</a> (unsigned int bufferFrames=1024)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Default constructor with optional output buffer size argument. <a href="#6f0168fca20a3c9d6d5f2baedf03ec1b"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileWvOut.html#1caea24a6c06ddd5f7f7876531bbd434">FileWvOut</a> (std::string fileName, unsigned int nChannels=1, FileWrite::FILE_TYPE type=<a class="el" href="classstk_1_1FileWrite.html#800875bbcac8f137ed94f5606d55f8c6">FileWrite::FILE_WAV</a>, Stk::StkFormat format=<a class="el" href="classstk_1_1Stk.html#5a807971b7fc3c8985d97823be079a7b">STK_SINT16</a>, unsigned int bufferFrames=1024)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Overloaded constructor used to specify a file name, type, and data format with this object. <a href="#1caea24a6c06ddd5f7f7876531bbd434"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="dd13d21d51f639961977b63cb481c36e"></a><!-- doxytag: member="stk::FileWvOut::~FileWvOut" ref="dd13d21d51f639961977b63cb481c36e" args="()" -->
|
|
virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileWvOut.html#dd13d21d51f639961977b63cb481c36e">~FileWvOut</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Class destructor. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileWvOut.html#31dde577d41a65018c3e03001de8d645">openFile</a> (std::string fileName, unsigned int nChannels, FileWrite::FILE_TYPE type, Stk::StkFormat format)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Open a new file with the specified parameters. <a href="#31dde577d41a65018c3e03001de8d645"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileWvOut.html#54cbced5ce278b0d16fa800e8445103c">closeFile</a> (void)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Close a file if one is open. <a href="#54cbced5ce278b0d16fa800e8445103c"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileWvOut.html#9d3505aea3cd3c4d6822f05a2679dc41">tick</a> (const StkFloat sample)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Output a single sample to all channels in a sample frame. <a href="#9d3505aea3cd3c4d6822f05a2679dc41"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileWvOut.html#417f5d967ae4dd425163d36c8563c0dc">tick</a> (const <a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &frames)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Output the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> data. <a href="#417f5d967ae4dd425163d36c8563c0dc"></a><br></td></tr>
|
|
</table>
|
|
<hr><a name="_details"></a><h2>Detailed Description</h2>
|
|
STK audio file output class.
|
|
<p>
|
|
This class inherits from <a class="el" href="classstk_1_1WvOut.html" title="STK audio output abstract base class.">WvOut</a>. It provides a "tick-level" interface to the <a class="el" href="classstk_1_1FileWrite.html" title="STK audio file output class.">FileWrite</a> class.<p>
|
|
<a class="el" href="classstk_1_1FileWvOut.html" title="STK audio file output class.">FileWvOut</a> writes samples to an audio file and supports multi-channel data. It is important to distinguish the <a class="el" href="classstk_1_1FileWvOut.html#9d3505aea3cd3c4d6822f05a2679dc41" title="Output a single sample to all channels in a sample frame.">tick()</a> method that outputs a single sample to all channels in a sample frame from the overloaded one that takes a reference to an <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> object for multi-channel and/or multi-frame data.<p>
|
|
See the <a class="el" href="classstk_1_1FileWrite.html" title="STK audio file output class.">FileWrite</a> class for a description of the supported audio file formats.<p>
|
|
Currently, <a class="el" href="classstk_1_1FileWvOut.html" title="STK audio file output class.">FileWvOut</a> is non-interpolating and the output rate is always <a class="el" href="classstk_1_1Stk.html#5fbe37000a611ce56075ee7d8936472d" title="Static method that returns the current STK sample rate.">Stk::sampleRate()</a>.<p>
|
|
by Perry R. Cook and Gary P. Scavone, 1995 - 2009. <hr><h2>Constructor & Destructor Documentation</h2>
|
|
<a class="anchor" name="6f0168fca20a3c9d6d5f2baedf03ec1b"></a><!-- doxytag: member="stk::FileWvOut::FileWvOut" ref="6f0168fca20a3c9d6d5f2baedf03ec1b" args="(unsigned int bufferFrames=1024)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">stk::FileWvOut::FileWvOut </td>
|
|
<td>(</td>
|
|
<td class="paramtype">unsigned int </td>
|
|
<td class="paramname"> <em>bufferFrames</em> = <code>1024</code> </td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Default constructor with optional output buffer size argument.
|
|
<p>
|
|
The output buffer size defines the number of frames that are accumulated between writes to disk.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="1caea24a6c06ddd5f7f7876531bbd434"></a><!-- doxytag: member="stk::FileWvOut::FileWvOut" ref="1caea24a6c06ddd5f7f7876531bbd434" args="(std::string fileName, unsigned int nChannels=1, FileWrite::FILE_TYPE type=FileWrite::FILE_WAV, Stk::StkFormat format=STK_SINT16, unsigned int bufferFrames=1024)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">stk::FileWvOut::FileWvOut </td>
|
|
<td>(</td>
|
|
<td class="paramtype">std::string </td>
|
|
<td class="paramname"> <em>fileName</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned int </td>
|
|
<td class="paramname"> <em>nChannels</em> = <code>1</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">FileWrite::FILE_TYPE </td>
|
|
<td class="paramname"> <em>type</em> = <code><a class="el" href="classstk_1_1FileWrite.html#800875bbcac8f137ed94f5606d55f8c6">FileWrite::FILE_WAV</a></code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">Stk::StkFormat </td>
|
|
<td class="paramname"> <em>format</em> = <code><a class="el" href="classstk_1_1Stk.html#5a807971b7fc3c8985d97823be079a7b">STK_SINT16</a></code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned int </td>
|
|
<td class="paramname"> <em>bufferFrames</em> = <code>1024</code></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Overloaded constructor used to specify a file name, type, and data format with this object.
|
|
<p>
|
|
An <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> is thrown for invalid argument values or if an error occurs when initializing the output file.
|
|
</div>
|
|
</div><p>
|
|
<hr><h2>Member Function Documentation</h2>
|
|
<a class="anchor" name="31dde577d41a65018c3e03001de8d645"></a><!-- doxytag: member="stk::FileWvOut::openFile" ref="31dde577d41a65018c3e03001de8d645" args="(std::string fileName, unsigned int nChannels, FileWrite::FILE_TYPE type, Stk::StkFormat format)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void stk::FileWvOut::openFile </td>
|
|
<td>(</td>
|
|
<td class="paramtype">std::string </td>
|
|
<td class="paramname"> <em>fileName</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">unsigned int </td>
|
|
<td class="paramname"> <em>nChannels</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">FileWrite::FILE_TYPE </td>
|
|
<td class="paramname"> <em>type</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">Stk::StkFormat </td>
|
|
<td class="paramname"> <em>format</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Open a new file with the specified parameters.
|
|
<p>
|
|
If a file was previously open, it will be closed. An <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> will be thrown if any of the specified arguments are invalid or a file error occurs during opening.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="54cbced5ce278b0d16fa800e8445103c"></a><!-- doxytag: member="stk::FileWvOut::closeFile" ref="54cbced5ce278b0d16fa800e8445103c" args="(void)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void stk::FileWvOut::closeFile </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void </td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Close a file if one is open.
|
|
<p>
|
|
Any data remaining in the internal buffer will be written to the file before closing.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="9d3505aea3cd3c4d6822f05a2679dc41"></a><!-- doxytag: member="stk::FileWvOut::tick" ref="9d3505aea3cd3c4d6822f05a2679dc41" args="(const StkFloat sample)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void stk::FileWvOut::tick </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const StkFloat </td>
|
|
<td class="paramname"> <em>sample</em> </td>
|
|
<td> ) </td>
|
|
<td><code> [virtual]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Output a single sample to all channels in a sample frame.
|
|
<p>
|
|
An <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> is thrown if an output error occurs.
|
|
<p>Implements <a class="el" href="classstk_1_1WvOut.html#7fe517928a0043353ebc2a852b49953c">stk::WvOut</a>.</p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="417f5d967ae4dd425163d36c8563c0dc"></a><!-- doxytag: member="stk::FileWvOut::tick" ref="417f5d967ae4dd425163d36c8563c0dc" args="(const StkFrames &frames)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void stk::FileWvOut::tick </td>
|
|
<td>(</td>
|
|
<td class="paramtype">const <a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> & </td>
|
|
<td class="paramname"> <em>frames</em> </td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Output the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> data.
|
|
<p>
|
|
An <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> will be thrown if an output error occurs. An <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> will also be thrown if _STK_DEBUG_ is defined during compilation and there is an incompatability between the number of channels in the <a class="el" href="classstk_1_1FileWvOut.html" title="STK audio file output class.">FileWvOut</a> object and that in the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> object.
|
|
</div>
|
|
</div><p>
|
|
<hr>The documentation for this class was generated from the following file:<ul>
|
|
<li><a class="el" href="FileWvOut_8h-source.html">FileWvOut.h</a></ul>
|
|
</div>
|
|
<HR>
|
|
|
|
<table>
|
|
<tr><td><A HREF="http://ccrma.stanford.edu/software/stk/"><I>The Synthesis ToolKit in C++ (STK)</I></A></td></tr>
|
|
<tr><td>©1995-2009 Perry R. Cook and Gary P. Scavone. All Rights Reserved.</td></tr>
|
|
</table>
|
|
|
|
</BODY>
|
|
</HTML>
|