mirror of
https://github.com/thestk/stk
synced 2026-01-15 05:51:52 +00:00
238 lines
15 KiB
HTML
238 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_1RtWvIn.html">RtWvIn</a>
|
|
</div>
|
|
<div class="contents">
|
|
<h1>stk::RtWvIn Class Reference</h1><!-- doxytag: class="stk::RtWvIn" --><!-- doxytag: inherits="stk::WvIn" -->STK realtime audio (blocking) input class.
|
|
<a href="#_details">More...</a>
|
|
<p>
|
|
<code>#include <<a class="el" href="RtWvIn_8h-source.html">RtWvIn.h</a>></code>
|
|
<p>
|
|
<div class="dynheader">
|
|
Inheritance diagram for stk::RtWvIn:</div>
|
|
<div class="dynsection">
|
|
|
|
<p><center><img src="classstk_1_1RtWvIn.png" usemap="#stk::RtWvIn_map" border="0" alt=""></center>
|
|
<map name="stk::RtWvIn_map">
|
|
<area href="classstk_1_1WvIn.html" alt="stk::WvIn" shape="rect" coords="0,56,72,80">
|
|
<area href="classstk_1_1Stk.html" alt="stk::Stk" shape="rect" coords="0,0,72,24">
|
|
</map>
|
|
</div>
|
|
|
|
<p>
|
|
<a href="classstk_1_1RtWvIn-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_1RtWvIn.html#b84c98c568346d1ad86251961f7d1fba">RtWvIn</a> (unsigned int nChannels=1, StkFloat sampleRate=Stk::sampleRate(), int device=0, int bufferFrames=RT_BUFFER_SIZE, int nBuffers=20)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Default constructor. <a href="#b84c98c568346d1ad86251961f7d1fba"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="efae2caa7f77522e8baa4908e3157f4d"></a><!-- doxytag: member="stk::RtWvIn::~RtWvIn" ref="efae2caa7f77522e8baa4908e3157f4d" args="()" -->
|
|
</td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1RtWvIn.html#efae2caa7f77522e8baa4908e3157f4d">~RtWvIn</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_1RtWvIn.html#0ae4012cb269fb70536611b9116142fa">start</a> (void)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Start the audio input stream. <a href="#0ae4012cb269fb70536611b9116142fa"></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_1RtWvIn.html#39d0d9702569ee3afa769309e8b2e152">stop</a> (void)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Stop the audio input stream. <a href="#39d0d9702569ee3afa769309e8b2e152"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1RtWvIn.html#3a4f4035fc01fee4c2423791f9e9317e">lastOut</a> (unsigned int channel=0)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Return the specified channel value of the last computed frame. <a href="#3a4f4035fc01fee4c2423791f9e9317e"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">StkFloat </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1RtWvIn.html#d2ace75cfe44dd82dd706d2c8dac7901">tick</a> (unsigned int channel=0)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Compute a sample frame and return the specified <code>channel</code> value. <a href="#d2ace75cfe44dd82dd706d2c8dac7901"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> & </td><td class="memItemRight" valign="bottom"><a class="el" href="classstk_1_1RtWvIn.html#38e698120ae0abf58dde995cba9e47cf">tick</a> (<a class="el" href="classstk_1_1StkFrames.html">StkFrames</a> &frames)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Fill the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> argument with computed frames and return the same reference. <a href="#38e698120ae0abf58dde995cba9e47cf"></a><br></td></tr>
|
|
</table>
|
|
<hr><a name="_details"></a><h2>Detailed Description</h2>
|
|
STK realtime audio (blocking) input class.
|
|
<p>
|
|
This class provides a simplified interface to <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> for realtime audio input. It is a subclass of <a class="el" href="classstk_1_1WvIn.html" title="STK audio input abstract base class.">WvIn</a>. This class makes use of RtAudio's callback functionality by creating a large ring-buffer from which data is read. This class should not be used when low-latency is desired.<p>
|
|
<a class="el" href="classstk_1_1RtWvIn.html" title="STK realtime audio (blocking) input class.">RtWvIn</a> supports multi-channel data in both interleaved and non-interleaved formats. It is important to distinguish the <a class="el" href="classstk_1_1RtWvIn.html#d2ace75cfe44dd82dd706d2c8dac7901" title="Compute a sample frame and return the specified channel value.">tick()</a> method that computes a single frame (and returns only the specified sample of a multi-channel frame) from the overloaded one that takes 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>
|
|
by Perry R. Cook and Gary P. Scavone, 1995 - 2009. <hr><h2>Constructor & Destructor Documentation</h2>
|
|
<a class="anchor" name="b84c98c568346d1ad86251961f7d1fba"></a><!-- doxytag: member="stk::RtWvIn::RtWvIn" ref="b84c98c568346d1ad86251961f7d1fba" args="(unsigned int nChannels=1, StkFloat sampleRate=Stk::sampleRate(), int device=0, int bufferFrames=RT_BUFFER_SIZE, int nBuffers=20)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">stk::RtWvIn::RtWvIn </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">StkFloat </td>
|
|
<td class="paramname"> <em>sampleRate</em> = <code>Stk::sampleRate()</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>device</em> = <code>0</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>bufferFrames</em> = <code>RT_BUFFER_SIZE</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">int </td>
|
|
<td class="paramname"> <em>nBuffers</em> = <code>20</code></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Default constructor.
|
|
<p>
|
|
The default <em>device</em> argument value (zero) will select the default input device on your system. The first device enumerated by the underlying audio API is specified with a value of one. The default buffer size of RT_BUFFER_SIZE is defined in <a class="el" href="Stk_8h-source.html">Stk.h</a>. An <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> will be thrown if an error occurs duing instantiation.
|
|
</div>
|
|
</div><p>
|
|
<hr><h2>Member Function Documentation</h2>
|
|
<a class="anchor" name="0ae4012cb269fb70536611b9116142fa"></a><!-- doxytag: member="stk::RtWvIn::start" ref="0ae4012cb269fb70536611b9116142fa" args="(void)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void stk::RtWvIn::start </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void </td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Start the audio input stream.
|
|
<p>
|
|
The stream is started automatically, if necessary, when a <a class="el" href="classstk_1_1RtWvIn.html#d2ace75cfe44dd82dd706d2c8dac7901" title="Compute a sample frame and return the specified channel value.">tick()</a> or tickFrame() method is called.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="39d0d9702569ee3afa769309e8b2e152"></a><!-- doxytag: member="stk::RtWvIn::stop" ref="39d0d9702569ee3afa769309e8b2e152" args="(void)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void stk::RtWvIn::stop </td>
|
|
<td>(</td>
|
|
<td class="paramtype">void </td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Stop the audio input stream.
|
|
<p>
|
|
It may be necessary to use this method to avoid audio underflow problems if you wish to temporarily stop audio input.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="3a4f4035fc01fee4c2423791f9e9317e"></a><!-- doxytag: member="stk::RtWvIn::lastOut" ref="3a4f4035fc01fee4c2423791f9e9317e" args="(unsigned int channel=0)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">StkFloat stk::RtWvIn::lastOut </td>
|
|
<td>(</td>
|
|
<td class="paramtype">unsigned int </td>
|
|
<td class="paramname"> <em>channel</em> = <code>0</code> </td>
|
|
<td> ) </td>
|
|
<td><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Return the specified channel value of the last computed frame.
|
|
<p>
|
|
For multi-channel files, use the <a class="el" href="classstk_1_1WvIn.html#3ab86e33eff9f962c9ef7b41e3ccb77e" title="Return an StkFrames reference to the last computed sample frame.">lastFrame()</a> function to get all values from the last computed frame. If the device is stopped, the returned value is 0.0. The <code>channel</code> argument must be less than the number of channels in the audio stream (the first channel is specified by 0). However, range checking is only performed if _STK_DEBUG_ is defined during compilation, in which case an out-of-range value will trigger an <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> exception.
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="d2ace75cfe44dd82dd706d2c8dac7901"></a><!-- doxytag: member="stk::RtWvIn::tick" ref="d2ace75cfe44dd82dd706d2c8dac7901" args="(unsigned int channel=0)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">StkFloat stk::RtWvIn::tick </td>
|
|
<td>(</td>
|
|
<td class="paramtype">unsigned int </td>
|
|
<td class="paramname"> <em>channel</em> = <code>0</code> </td>
|
|
<td> ) </td>
|
|
<td><code> [virtual]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Compute a sample frame and return the specified <code>channel</code> value.
|
|
<p>
|
|
For multi-channel files, use the <a class="el" href="classstk_1_1WvIn.html#3ab86e33eff9f962c9ef7b41e3ccb77e" title="Return an StkFrames reference to the last computed sample frame.">lastFrame()</a> function to get all values from the computed frame. If the device is "stopped", it is "started". The <code>channel</code> argument must be less than the number of channels in the audio stream (the first channel is specified by 0). However, range checking is only performed if _STK_DEBUG_ is defined during compilation, in which case an out-of-range value will trigger an <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> exception.
|
|
<p>Implements <a class="el" href="classstk_1_1WvIn.html#0eda243730408a434856fffed776931e">stk::WvIn</a>.</p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="38e698120ae0abf58dde995cba9e47cf"></a><!-- doxytag: member="stk::RtWvIn::tick" ref="38e698120ae0abf58dde995cba9e47cf" args="(StkFrames &frames)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classstk_1_1StkFrames.html">StkFrames</a>& stk::RtWvIn::tick </td>
|
|
<td>(</td>
|
|
<td class="paramtype"><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>
|
|
Fill the <a class="el" href="classstk_1_1StkFrames.html" title="An STK class to handle vectorized audio data.">StkFrames</a> argument with computed frames and return the same reference.
|
|
<p>
|
|
If the device is "stopped", it is "started". 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 must equal the number of channels specified during instantiation. However, this is only checked if _STK_DEBUG_ is defined during compilation, in which case an incompatibility will trigger an <a class="el" href="classstk_1_1StkError.html" title="STK error handling class.">StkError</a> exception.
|
|
</div>
|
|
</div><p>
|
|
<hr>The documentation for this class was generated from the following file:<ul>
|
|
<li><a class="el" href="RtWvIn_8h-source.html">RtWvIn.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>
|