mirror of
https://github.com/thestk/stk
synced 2026-01-13 13:01:52 +00:00
817 lines
30 KiB
HTML
817 lines
30 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="links.html">Links</a> <a class="qindex" href="tutorial.html">Tutorial</a></CENTER>
|
|
<HR>
|
|
<!-- Generated by Doxygen 1.2.8.1 -->
|
|
<h1>RtAudio Class Reference</h1>Realtime audio i/o C++ class.
|
|
<a href="#_details">More...</a>
|
|
<p>
|
|
<code>#include <<a class="el" href="RtAudio_8h-source.html">RtAudio.h</a>></code>
|
|
<p>
|
|
<a href="classRtAudio-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> </td><td valign=bottom><a class="el" href="classRtAudio.html#a0">RtAudio</a> ()</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>The default constructor.</em> <a href="#a0">More...</a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classRtAudio.html#a1">RtAudio</a> (int *streamId, int outputDevice, int outputChannels, int inputDevice, int inputChannels, RTAUDIO_FORMAT format, int sampleRate, int *bufferSize, int numberOfBuffers)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>A constructor which can be used to open a stream during instantiation.</em> <a href="#a1">More...</a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classRtAudio.html#a2">~RtAudio</a> ()</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>The destructor.</em> <a href="#a2">More...</a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="classRtAudio.html#a3">openStream</a> (int outputDevice, int outputChannels, int inputDevice, int inputChannels, RTAUDIO_FORMAT format, int sampleRate, int *bufferSize, int numberOfBuffers)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>A public method for opening a stream with the specified parameters.</em> <a href="#a3">More...</a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classRtAudio.html#a4">setStreamCallback</a> (int streamId, RTAUDIO_CALLBACK callback, void *userData)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>A public method which sets a user-defined callback function for a given stream.</em> <a href="#a4">More...</a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classRtAudio.html#a5">cancelStreamCallback</a> (int streamId)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>A public method which cancels a callback process and function for a given stream.</em> <a href="#a5">More...</a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top><a name="a6" doxytag="RtAudio::getDeviceCount"></a>
|
|
int </td><td valign=bottom><a class="el" href="classRtAudio.html#a6">getDeviceCount</a> (void)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>A public method which returns the number of audio devices found.</em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classRtAudio.html#a7">getDeviceInfo</a> (int device, <a class="el" href="structRtAudio_1_1RTAUDIO__DEVICE.html">RTAUDIO_DEVICE</a> *info)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Fill a user-supplied <a class="el" href="structRtAudio_1_1RTAUDIO__DEVICE.html">RTAUDIO_DEVICE</a> structure for a specified device number.</em> <a href="#a7">More...</a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>char* const </td><td valign=bottom><a class="el" href="classRtAudio.html#a8">getStreamBuffer</a> (int streamId)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>A public method which returns a pointer to the buffer for an open stream.</em> <a href="#a8">More...</a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classRtAudio.html#a9">tickStream</a> (int streamId)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Public method used to trigger processing of input/output data for a stream.</em> <a href="#a9">More...</a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classRtAudio.html#a10">closeStream</a> (int streamId)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Public method which closes a stream and frees any associated buffers.</em> <a href="#a10">More...</a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classRtAudio.html#a11">startStream</a> (int streamId)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Public method which starts a stream.</em> <a href="#a11">More...</a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classRtAudio.html#a12">stopStream</a> (int streamId)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Stop a stream, allowing any samples remaining in the queue to be played out and/or read in.</em> <a href="#a12">More...</a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classRtAudio.html#a13">abortStream</a> (int streamId)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Stop a stream, discarding any samples remaining in the input/output queue.</em> <a href="#a13">More...</a><em></em></font><br><br></td></tr>
|
|
<tr><td nowrap align=right valign=top>int </td><td valign=bottom><a class="el" href="classRtAudio.html#a14">streamWillBlock</a> (int streamId)</td></tr>
|
|
<tr><td> </td><td><font size=-1><em>Queries a stream to determine whether a call to the <a class="el" href="classRtAudio.html#a9">tickStream</a>() method will block.</em> <a href="#a14">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 RTAUDIO_FORMAT </td><td valign=bottom><a class="el" href="classRtAudio.html#p0">RTAUDIO_SINT8</a></td></tr>
|
|
<tr><td nowrap align=right valign=top>const RTAUDIO_FORMAT </td><td valign=bottom><a class="el" href="classRtAudio.html#p1">RTAUDIO_SINT16</a></td></tr>
|
|
<tr><td nowrap align=right valign=top>const RTAUDIO_FORMAT </td><td valign=bottom><a class="el" href="classRtAudio.html#p2">RTAUDIO_SINT24</a></td></tr>
|
|
<tr><td nowrap align=right valign=top>const RTAUDIO_FORMAT </td><td valign=bottom><a class="el" href="classRtAudio.html#p3">RTAUDIO_SINT32</a></td></tr>
|
|
<tr><td nowrap align=right valign=top>const RTAUDIO_FORMAT </td><td valign=bottom><a class="el" href="classRtAudio.html#p4">RTAUDIO_FLOAT32</a></td></tr>
|
|
<tr><td nowrap align=right valign=top>const RTAUDIO_FORMAT </td><td valign=bottom><a class="el" href="classRtAudio.html#p5">RTAUDIO_FLOAT64</a></td></tr>
|
|
</table>
|
|
<hr><a name="_details"></a><h2>Detailed Description</h2>
|
|
Realtime audio i/o C++ class.
|
|
<p>
|
|
RtAudio provides a common API (Application Programming Interface) for realtime audio input/output across Linux (native ALSA and OSS), SGI, Macintosh OS X (CoreAudio), and Windows (DirectSound and ASIO) operating systems.
|
|
<p>
|
|
RtAudio WWW site: <a href="http://www-ccrma.stanford.edu/~gary/rtaudio/">http://www-ccrma.stanford.edu/~gary/rtaudio/</a>
|
|
<p>
|
|
RtAudio: a realtime audio i/o C++ class Copyright (c) 2001-2002 Gary P. Scavone
|
|
<p>
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
<p>
|
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
<p>
|
|
Any person wishing to distribute modifications to the Software is requested to send the modifications to the original developer so that they can be incorporated into the canonical version.
|
|
<p>
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
<p>
|
|
<hr><h2>Constructor & Destructor Documentation</h2>
|
|
<a name="a0" doxytag="RtAudio::RtAudio"></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>
|
|
RtAudio::RtAudio (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
)
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
The default constructor.
|
|
<p>
|
|
Probes the system to make sure at least one audio input/output device is available and determines the api-specific identifier for each device found. An <a class="el" href="classRtError.html">RtError</a> error can be thrown if no devices are found or if a memory allocation error occurs. </td>
|
|
</tr>
|
|
</table>
|
|
<a name="a1" doxytag="RtAudio::RtAudio"></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>
|
|
RtAudio::RtAudio (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
int * <em>streamId</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
int <em>outputDevice</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
int <em>outputChannels</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
int <em>inputDevice</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
int <em>inputChannels</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
RTAUDIO_FORMAT <em>format</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
int <em>sampleRate</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
int * <em>bufferSize</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
int <em>numberOfBuffers</em> )
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
A constructor which can be used to open a stream during instantiation.
|
|
<p>
|
|
The specified output and/or input device identifiers correspond to those enumerated via the <a class="el" href="classRtAudio.html#a7">getDeviceInfo</a>() method. If device = 0, the default or first available devices meeting the given parameters is selected. If an output or input channel value is zero, the corresponding device value is ignored. When a stream is successfully opened, its identifier is returned via the "streamId" pointer. An <a class="el" href="classRtError.html">RtError</a> can be thrown if no devices are found for the given parameters, if a memory allocation error occurs, or if a driver error occurs. <dl compact><dt>
|
|
<b>See also: </b><dd>
|
|
<a class="el" href="classRtAudio.html#a3">openStream</a>() </dl> </td>
|
|
</tr>
|
|
</table>
|
|
<a name="a2" doxytag="RtAudio::~RtAudio"></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>
|
|
RtAudio::~RtAudio (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
)
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
The destructor.
|
|
<p>
|
|
Stops and closes any open streams and devices and deallocates buffer and structure memory. </td>
|
|
</tr>
|
|
</table>
|
|
<hr><h2>Member Function Documentation</h2>
|
|
<a name="a3" doxytag="RtAudio::openStream"></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>
|
|
int RtAudio::openStream (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
int <em>outputDevice</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
int <em>outputChannels</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
int <em>inputDevice</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
int <em>inputChannels</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
RTAUDIO_FORMAT <em>format</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
int <em>sampleRate</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
int * <em>bufferSize</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
int <em>numberOfBuffers</em> )
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
A public method for opening a stream with the specified parameters.
|
|
<p>
|
|
If successful, the opened stream ID is returned. Otherwise, an <a class="el" href="classRtError.html">RtError</a> is thrown.<dl compact><dt>
|
|
<b>Parameters: </b><dd>
|
|
<table border=0 cellspacing=2 cellpadding=0>
|
|
<tr><td valign=top><em>outputDevice:</em>
|
|
</td><td>
|
|
If equal to 0, the default or first device found meeting the given parameters is opened. Otherwise, the device number should correspond to one of those enumerated via the <a class="el" href="classRtAudio.html#a7">getDeviceInfo</a>() method. </td></tr>
|
|
<tr><td valign=top><em>outputChannels:</em>
|
|
</td><td>
|
|
The desired number of output channels. If equal to zero, the outputDevice identifier is ignored. </td></tr>
|
|
<tr><td valign=top><em>inputDevice:</em>
|
|
</td><td>
|
|
If equal to 0, the default or first device found meeting the given parameters is opened. Otherwise, the device number should correspond to one of those enumerated via the <a class="el" href="classRtAudio.html#a7">getDeviceInfo</a>() method. </td></tr>
|
|
<tr><td valign=top><em>inputChannels:</em>
|
|
</td><td>
|
|
The desired number of input channels. If equal to zero, the inputDevice identifier is ignored. </td></tr>
|
|
<tr><td valign=top><em>format:</em>
|
|
</td><td>
|
|
An RTAUDIO_FORMAT specifying the desired sample data format. </td></tr>
|
|
<tr><td valign=top><em>sampleRate:</em>
|
|
</td><td>
|
|
The desired sample rate (sample frames per second). </td></tr>
|
|
<tr><td valign=top><em>bufferSize:</em>
|
|
</td><td>
|
|
A pointer value indicating the desired internal buffer size in sample frames. The actual value used by the device is returned via the same pointer. A value of zero can be specified, in which case the lowest allowable value is determined. </td></tr>
|
|
<tr><td valign=top><em>numberOfBuffers:</em>
|
|
</td><td>
|
|
A value which can be used to help control device latency. More buffers typically result in more robust performance, though at a cost of greater latency. A value of zero can be specified, in which case the lowest allowable value is used. </td></tr>
|
|
</table>
|
|
</dl> </td>
|
|
</tr>
|
|
</table>
|
|
<a name="a4" doxytag="RtAudio::setStreamCallback"></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 RtAudio::setStreamCallback (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
int <em>streamId</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
RTAUDIO_CALLBACK <em>callback</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
void * <em>userData</em> )
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
A public method which sets a user-defined callback function for a given stream.
|
|
<p>
|
|
This method assigns a callback function to a specific, previously opened stream for non-blocking stream functionality. A separate process is initiated, though the user function is called only when the stream is "running" (between calls to the <a class="el" href="classRtAudio.html#a11">startStream</a>() and <a class="el" href="classRtAudio.html#a12">stopStream</a>() methods, respectively). The callback process remains active for the duration of the stream and is automatically shutdown when the stream is closed (via the <a class="el" href="classRtAudio.html#a10">closeStream</a>() method or by object destruction). The callback process can also be shutdown and the user function de-referenced through an explicit call to the <a class="el" href="classRtAudio.html#a5">cancelStreamCallback</a>() method. Note that a single stream can use only blocking or callback functionality at the same time, though it is possible to alternate modes on the same stream through the use of the <a class="el" href="classRtAudio.html#a4">setStreamCallback</a>() and <a class="el" href="classRtAudio.html#a5">cancelStreamCallback</a>() methods (the blocking <a class="el" href="classRtAudio.html#a9">tickStream</a>() method can be used before a callback is set and/or after a callback is cancelled). An <a class="el" href="classRtError.html">RtError</a> will be thrown for an invalid device argument. </td>
|
|
</tr>
|
|
</table>
|
|
<a name="a5" doxytag="RtAudio::cancelStreamCallback"></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 RtAudio::cancelStreamCallback (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
int <em>streamId</em> )
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
A public method which cancels a callback process and function for a given stream.
|
|
<p>
|
|
This method shuts down a callback process and de-references the user function for a specific stream. Callback functionality can subsequently be restarted on the stream via the <a class="el" href="classRtAudio.html#a4">setStreamCallback</a>() method. An <a class="el" href="classRtError.html">RtError</a> will be thrown for an invalid device argument. </td>
|
|
</tr>
|
|
</table>
|
|
<a name="a7" doxytag="RtAudio::getDeviceInfo"></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 RtAudio::getDeviceInfo (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
int <em>device</em>,
|
|
</b></td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td><b>
|
|
<a class="el" href="structRtAudio_1_1RTAUDIO__DEVICE.html">RTAUDIO_DEVICE</a> * <em>info</em> )
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Fill a user-supplied <a class="el" href="structRtAudio_1_1RTAUDIO__DEVICE.html">RTAUDIO_DEVICE</a> structure for a specified device number.
|
|
<p>
|
|
Any device integer between 1 and <a class="el" href="classRtAudio.html#a6">getDeviceCount</a>() is valid. If a device is busy or otherwise unavailable, the structure member "probed" will have a value of "false" and all other members are undefined. If the specified device is the current default input or output device, the "isDefault" member will have a value of "true". An <a class="el" href="classRtError.html">RtError</a> will be thrown for an invalid device argument. </td>
|
|
</tr>
|
|
</table>
|
|
<a name="a8" doxytag="RtAudio::getStreamBuffer"></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>
|
|
char *const RtAudio::getStreamBuffer (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
int <em>streamId</em> )
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
A public method which returns a pointer to the buffer for an open stream.
|
|
<p>
|
|
The user should fill and/or read the buffer data in interleaved format and then call the <a class="el" href="classRtAudio.html#a9">tickStream</a>() method. An <a class="el" href="classRtError.html">RtError</a> will be thrown for an invalid stream identifier. </td>
|
|
</tr>
|
|
</table>
|
|
<a name="a9" doxytag="RtAudio::tickStream"></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 RtAudio::tickStream (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
int <em>streamId</em> )
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Public method used to trigger processing of input/output data for a stream.
|
|
<p>
|
|
This method blocks until all buffer data is read/written. An <a class="el" href="classRtError.html">RtError</a> will be thrown for an invalid stream identifier or if a driver error occurs. </td>
|
|
</tr>
|
|
</table>
|
|
<a name="a10" doxytag="RtAudio::closeStream"></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 RtAudio::closeStream (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
int <em>streamId</em> )
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Public method which closes a stream and frees any associated buffers.
|
|
<p>
|
|
If an invalid stream identifier is specified, this method issues a warning and returns (an <a class="el" href="classRtError.html">RtError</a> is not thrown). </td>
|
|
</tr>
|
|
</table>
|
|
<a name="a11" doxytag="RtAudio::startStream"></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 RtAudio::startStream (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
int <em>streamId</em> )
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Public method which starts a stream.
|
|
<p>
|
|
An <a class="el" href="classRtError.html">RtError</a> will be thrown for an invalid stream identifier or if a driver error occurs. </td>
|
|
</tr>
|
|
</table>
|
|
<a name="a12" doxytag="RtAudio::stopStream"></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 RtAudio::stopStream (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
int <em>streamId</em> )
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Stop a stream, allowing any samples remaining in the queue to be played out and/or read in.
|
|
<p>
|
|
An <a class="el" href="classRtError.html">RtError</a> will be thrown for an invalid stream identifier or if a driver error occurs. </td>
|
|
</tr>
|
|
</table>
|
|
<a name="a13" doxytag="RtAudio::abortStream"></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 RtAudio::abortStream (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
int <em>streamId</em> )
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Stop a stream, discarding any samples remaining in the input/output queue.
|
|
<p>
|
|
An <a class="el" href="classRtError.html">RtError</a> will be thrown for an invalid stream identifier or if a driver error occurs. </td>
|
|
</tr>
|
|
</table>
|
|
<a name="a14" doxytag="RtAudio::streamWillBlock"></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>
|
|
int RtAudio::streamWillBlock (
|
|
</b></td>
|
|
<td valign="bottom"><b>
|
|
int <em>streamId</em> )
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Queries a stream to determine whether a call to the <a class="el" href="classRtAudio.html#a9">tickStream</a>() method will block.
|
|
<p>
|
|
A return value of 0 indicates that the stream will NOT block. A positive return value indicates the number of sample frames that cannot yet be processed without blocking. </td>
|
|
</tr>
|
|
</table>
|
|
<hr><h2>Member Data Documentation</h2>
|
|
<a name="p0" doxytag="RtAudio::RTAUDIO_SINT8"></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 RTAUDIO_FORMAT RtAudio::RTAUDIO_SINT8<code> [static]</code>
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
8-bit signed integer. </td>
|
|
</tr>
|
|
</table>
|
|
<a name="p1" doxytag="RtAudio::RTAUDIO_SINT16"></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 RTAUDIO_FORMAT RtAudio::RTAUDIO_SINT16<code> [static]</code>
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
16-bit signed integer. </td>
|
|
</tr>
|
|
</table>
|
|
<a name="p2" doxytag="RtAudio::RTAUDIO_SINT24"></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 RTAUDIO_FORMAT RtAudio::RTAUDIO_SINT24<code> [static]</code>
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Upper 3 bytes of 32-bit signed integer. </td>
|
|
</tr>
|
|
</table>
|
|
<a name="p3" doxytag="RtAudio::RTAUDIO_SINT32"></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 RTAUDIO_FORMAT RtAudio::RTAUDIO_SINT32<code> [static]</code>
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
32-bit signed integer. </td>
|
|
</tr>
|
|
</table>
|
|
<a name="p4" doxytag="RtAudio::RTAUDIO_FLOAT32"></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 RTAUDIO_FORMAT RtAudio::RTAUDIO_FLOAT32<code> [static]</code>
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Normalized between plus/minus 1.0. </td>
|
|
</tr>
|
|
</table>
|
|
<a name="p5" doxytag="RtAudio::RTAUDIO_FLOAT64"></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 RTAUDIO_FORMAT RtAudio::RTAUDIO_FLOAT64<code> [static]</code>
|
|
</b></td>
|
|
</tr>
|
|
|
|
</table>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<table cellspacing=5 cellpadding=0 border=0>
|
|
<tr>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
|
|
<p>
|
|
Normalized between plus/minus 1.0. </td>
|
|
</tr>
|
|
</table>
|
|
<hr>The documentation for this class was generated from the following file:<ul>
|
|
<li><a class="el" href="RtAudio_8h-source.html">RtAudio.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>
|