mirror of
https://github.com/thestk/stk
synced 2026-01-12 04:21:52 +00:00
275 lines
16 KiB
HTML
275 lines
16 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_1FileWrite.html">FileWrite</a>
|
|
</div>
|
|
<div class="contents">
|
|
<h1>stk::FileWrite Class Reference</h1><!-- doxytag: class="stk::FileWrite" --><!-- doxytag: inherits="stk::Stk" -->STK audio file output class.
|
|
<a href="#_details">More...</a>
|
|
<p>
|
|
<code>#include <<a class="el" href="FileWrite_8h-source.html">FileWrite.h</a>></code>
|
|
<p>
|
|
<div class="dynheader">
|
|
Inheritance diagram for stk::FileWrite:</div>
|
|
<div class="dynsection">
|
|
|
|
<p><center><img src="classstk_1_1FileWrite.png" usemap="#stk::FileWrite_map" border="0" alt=""></center>
|
|
<map name="stk::FileWrite_map">
|
|
<area href="classstk_1_1Stk.html" alt="stk::Stk" shape="rect" coords="0,0,83,24">
|
|
</map>
|
|
</div>
|
|
|
|
<p>
|
|
<a href="classstk_1_1FileWrite-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="b362583b465c41ac0b411722621e9d3d"></a><!-- doxytag: member="stk::FileWrite::FileWrite" ref="b362583b465c41ac0b411722621e9d3d" args="(void)" -->
|
|
</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileWrite.html#b362583b465c41ac0b411722621e9d3d">FileWrite</a> (void)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileWrite.html#207f10bba60355fe3dc62dc837edee46">FileWrite</a> (std::string fileName, unsigned int nChannels=1, FILE_TYPE type=<a class="el" href="classstk_1_1FileWrite.html#800875bbcac8f137ed94f5606d55f8c6">FILE_WAV</a>, Stk::StkFormat format=<a class="el" href="classstk_1_1Stk.html#5a807971b7fc3c8985d97823be079a7b">STK_SINT16</a>)</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="#207f10bba60355fe3dc62dc837edee46"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="c4da2511c8d0640ec5484f88bd704747"></a><!-- doxytag: member="stk::FileWrite::~FileWrite" ref="c4da2511c8d0640ec5484f88bd704747" args="()" -->
|
|
virtual </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileWrite.html#c4da2511c8d0640ec5484f88bd704747">~FileWrite</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_1FileWrite.html#7575ddb275c902207b7b6518bb5a4ed9">open</a> (std::string fileName, unsigned int nChannels=1, FileWrite::FILE_TYPE type=<a class="el" href="classstk_1_1FileWrite.html#800875bbcac8f137ed94f5606d55f8c6">FILE_WAV</a>, Stk::StkFormat format=<a class="el" href="classstk_1_1Stk.html#5a807971b7fc3c8985d97823be079a7b">STK_SINT16</a>)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </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="#7575ddb275c902207b7b6518bb5a4ed9"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="99a19988a4dd8d608b74421cfb6cbc69"></a><!-- doxytag: member="stk::FileWrite::close" ref="99a19988a4dd8d608b74421cfb6cbc69" args="(void)" -->
|
|
void </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileWrite.html#99a19988a4dd8d608b74421cfb6cbc69">close</a> (void)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">If a file is open, write out samples in the queue and then close it. <br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="636436624aa39eb5ba3401a9279a173e"></a><!-- doxytag: member="stk::FileWrite::isOpen" ref="636436624aa39eb5ba3401a9279a173e" args="(void)" -->
|
|
bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileWrite.html#636436624aa39eb5ba3401a9279a173e">isOpen</a> (void)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns <em>true</em> if a file is currently open. <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_1FileWrite.html#d33ca8e729c14296af6dce457445832e">write</a> (<a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &buffer)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Write sample frames from the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> object to the file. <a href="#d33ca8e729c14296af6dce457445832e"></a><br></td></tr>
|
|
<tr><td colspan="2"><br><h2>Static Public Attributes</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">static const FILE_TYPE </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileWrite.html#c9e286cfc8037327eef493439e78f31e">FILE_RAW</a></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">static const FILE_TYPE </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileWrite.html#800875bbcac8f137ed94f5606d55f8c6">FILE_WAV</a></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">static const FILE_TYPE </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileWrite.html#1ae24c549fc9fa2c8ef4a6ff94ccc345">FILE_SND</a></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">static const FILE_TYPE </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileWrite.html#678074f8bfa198627ed8ee9f52a42c0e">FILE_AIF</a></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">static const FILE_TYPE </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1FileWrite.html#d06e073000f613c43c48707c724d104e">FILE_MAT</a></td></tr>
|
|
|
|
</table>
|
|
<hr><a name="_details"></a><h2>Detailed Description</h2>
|
|
STK audio file output class.
|
|
<p>
|
|
This class provides output support for various audio file formats.<p>
|
|
<a class="el" href="classstk_1_1FileWrite.html" title="STK audio file output class.">FileWrite</a> writes samples to an audio file. It supports multi-channel data.<p>
|
|
<a class="el" href="classstk_1_1FileWrite.html" title="STK audio file output class.">FileWrite</a> currently supports uncompressed 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. Compressed data types are not supported.<p>
|
|
by Perry R. Cook and Gary P. Scavone, 1995 - 2009. <hr><h2>Constructor & Destructor Documentation</h2>
|
|
<a class="anchor" name="207f10bba60355fe3dc62dc837edee46"></a><!-- doxytag: member="stk::FileWrite::FileWrite" ref="207f10bba60355fe3dc62dc837edee46" args="(std::string fileName, unsigned int nChannels=1, FILE_TYPE type=FILE_WAV, Stk::StkFormat format=STK_SINT16)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">stk::FileWrite::FileWrite </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">FILE_TYPE </td>
|
|
<td class="paramname"> <em>type</em> = <code><a class="el" href="classstk_1_1FileWrite.html#800875bbcac8f137ed94f5606d55f8c6">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><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="7575ddb275c902207b7b6518bb5a4ed9"></a><!-- doxytag: member="stk::FileWrite::open" ref="7575ddb275c902207b7b6518bb5a4ed9" args="(std::string fileName, unsigned int nChannels=1, FileWrite::FILE_TYPE type=FILE_WAV, Stk::StkFormat format=STK_SINT16)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void stk::FileWrite::open </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">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><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<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="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>
|
|
<a class="anchor" name="d33ca8e729c14296af6dce457445832e"></a><!-- doxytag: member="stk::FileWrite::write" ref="d33ca8e729c14296af6dce457445832e" args="(StkFrames &buffer)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void stk::FileWrite::write </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> & </td>
|
|
<td class="paramname"> <em>buffer</em> </td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Write sample frames from the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> object to the file.
|
|
<p>
|
|
An <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> will be thrown if the number of channels in the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> argument does not agree with the number of channels specified when opening the file.
|
|
</div>
|
|
</div><p>
|
|
<hr><h2>Member Data Documentation</h2>
|
|
<a class="anchor" name="c9e286cfc8037327eef493439e78f31e"></a><!-- doxytag: member="stk::FileWrite::FILE_RAW" ref="c9e286cfc8037327eef493439e78f31e" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const FILE_TYPE <a class="el" href="classstk_1_1FileWrite.html#c9e286cfc8037327eef493439e78f31e">stk::FileWrite::FILE_RAW</a><code> [static]</code> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
STK RAW file type.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="800875bbcac8f137ed94f5606d55f8c6"></a><!-- doxytag: member="stk::FileWrite::FILE_WAV" ref="800875bbcac8f137ed94f5606d55f8c6" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const FILE_TYPE <a class="el" href="classstk_1_1FileWrite.html#800875bbcac8f137ed94f5606d55f8c6">stk::FileWrite::FILE_WAV</a><code> [static]</code> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
WAV file type.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="1ae24c549fc9fa2c8ef4a6ff94ccc345"></a><!-- doxytag: member="stk::FileWrite::FILE_SND" ref="1ae24c549fc9fa2c8ef4a6ff94ccc345" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const FILE_TYPE <a class="el" href="classstk_1_1FileWrite.html#1ae24c549fc9fa2c8ef4a6ff94ccc345">stk::FileWrite::FILE_SND</a><code> [static]</code> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
SND (AU) file type.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="678074f8bfa198627ed8ee9f52a42c0e"></a><!-- doxytag: member="stk::FileWrite::FILE_AIF" ref="678074f8bfa198627ed8ee9f52a42c0e" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const FILE_TYPE <a class="el" href="classstk_1_1FileWrite.html#678074f8bfa198627ed8ee9f52a42c0e">stk::FileWrite::FILE_AIF</a><code> [static]</code> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
AIFF file type.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="d06e073000f613c43c48707c724d104e"></a><!-- doxytag: member="stk::FileWrite::FILE_MAT" ref="d06e073000f613c43c48707c724d104e" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const FILE_TYPE <a class="el" href="classstk_1_1FileWrite.html#d06e073000f613c43c48707c724d104e">stk::FileWrite::FILE_MAT</a><code> [static]</code> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Matlab MAT-file type.
|
|
</div>
|
|
</div><p>
|
|
<hr>The documentation for this class was generated from the following file:<ul>
|
|
<li><a class="el" href="FileWrite_8h-source.html">FileWrite.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>
|