proteaAudio/doc/class_device_audio_rt.html
2012-05-27 18:34:36 -04:00

846 lines
35 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>proteaAudio</title>
<link href="protea.css" rel="stylesheet" type="text/css">
</head><body>
<div style="text-align: center"><img src="proteaAudio.png"/></div>
<!-- Generated by Doxygen 1.4.3 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Class&nbsp;List</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Class&nbsp;Members</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<h1>DeviceAudioRt Class Reference</h1><!-- doxytag: class=<DeviceAudioRt> --><!-- doxytag: inherits=<DeviceAudio> -->an rtAudio based stereo audio mixer/playback device
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="pro_audio_rt_8h-source.html">proAudioRt.h</a>&gt;</code>
<p>
<p>Inheritance diagram for DeviceAudioRt:
<p><center><img src="class_device_audio_rt.png" usemap="#DeviceAudioRt_map" border="0" alt=""></center>
<map name="DeviceAudioRt_map">
<area href="class_device_audio.html" alt="DeviceAudio" shape="rect" coords="0,0,96,24">
</map>
<a href="class_device_audio_rt-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">virtual unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio_rt.html#a0">sampleFromMemory</a> (const <a class="el" href="class_audio_sample.html">AudioSample</a> &amp;sample, float volume=1.0f)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio_rt.html#a1">sampleDestroy</a> (unsigned int sample)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual const <a class="el" href="class_audio_sample.html">AudioSample</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio_rt.html#a2">sample</a> (unsigned int handle) const </td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio_rt.html#a3">soundPlay</a> (unsigned int sample, float volumeL=1.0f, float volumeR=1.0f, float disparity=0.0f, float pitch=1.0f)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio_rt.html#a4">soundLoop</a> (unsigned int sample, float volumeL=1.0f, float volumeR=1.0f, float disparity=0.0f, float pitch=1.0f)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio_rt.html#a5">soundUpdate</a> (unsigned int sound, float volumeL, float volumeR, float disparity=0.0f, float pitch=1.0f)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio_rt.html#a6">soundStop</a> (unsigned int sound)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio_rt.html#a7">soundStop</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual unsigned&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio_rt.html#a8">soundActive</a> () const </td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <a class="el" href="class_device_audio.html">DeviceAudio</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio_rt.html#e0">create</a> (unsigned int nTracks=8, unsigned int frequency=22050, unsigned int chunkSize=1024)</td></tr>
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio_rt.html#b0">DeviceAudioRt</a> (unsigned int nTracks, unsigned int frequency, unsigned int chunkSize)</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio_rt.html#b1">~DeviceAudioRt</a> ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio_rt.html#b2">mixOutputFloat</a> (signed short *outputBuffer, unsigned int nFrames)</td></tr>
<tr><td colspan="2"><br><h2>Static Protected Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio_rt.html#f0">cbMix</a> (void *outputBuffer, void *inputBuffer, unsigned int nFrames, double streamTime, RtAudioStreamStatus status, void *data)</td></tr>
<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">std::map&lt; unsigned int, <a class="el" href="class_audio_sample.html">AudioSample</a> * &gt;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio_rt.html#p0">mm_sample</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio_rt.html#p1">m_sampleCounter</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">_AudioTrack *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio_rt.html#p2">ma_sound</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio_rt.html#p3">m_nSound</a></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">RtAudio&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_device_audio_rt.html#p4">m_dac</a></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
an rtAudio based stereo audio mixer/playback device
<p>
DeviceAudioRt offers some advanced features such as dynamic pitch, independent volume control for both channels, and user-defined time shifts between the channels.
<p>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="b0"></a><!-- doxytag: member=<DeviceAudioRt::DeviceAudioRt> ref=<b0> args=<(unsigned int nTracks, unsigned int frequency, unsigned int chunkSize)> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">DeviceAudioRt::DeviceAudioRt </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>nTracks</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>frequency</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>chunkSize</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [protected]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
constructor. Use the <a class="el" href="class_device_audio_rt.html#e0">create()</a> method instead
<p>
</td>
</tr>
</table>
<a class="anchor" name="b1"></a><!-- doxytag: member=<DeviceAudioRt::~DeviceAudioRt> ref=<b1> args=<()> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual DeviceAudioRt::~DeviceAudioRt </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [protected, virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
destructor. Use the <a class="el" href="class_device_audio.html#e1">destroy()</a> method instead
<p>
</td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="f0"></a><!-- doxytag: member=<DeviceAudioRt::cbMix> ref=<f0> args=<(void *outputBuffer, void *inputBuffer, unsigned int nFrames, double streamTime, RtAudioStreamStatus status, void *data)> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">static int DeviceAudioRt::cbMix </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">void *&nbsp;</td>
<td class="mdname" nowrap> <em>outputBuffer</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>void *&nbsp;</td>
<td class="mdname" nowrap> <em>inputBuffer</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>nFrames</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>double&nbsp;</td>
<td class="mdname" nowrap> <em>streamTime</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>RtAudioStreamStatus&nbsp;</td>
<td class="mdname" nowrap> <em>status</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>void *&nbsp;</td>
<td class="mdname" nowrap> <em>data</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [inline, static, protected]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
mixer callback
<p>
</td>
</tr>
</table>
<a class="anchor" name="e0"></a><!-- doxytag: member=<DeviceAudioRt::create> ref=<e0> args=<(unsigned int nTracks=8, unsigned int frequency=22050, unsigned int chunkSize=1024)> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">static <a class="el" href="class_device_audio.html">DeviceAudio</a>* DeviceAudioRt::create </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>nTracks</em> = <code>8</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>frequency</em> = <code>22050</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>chunkSize</em> = <code>1024</code></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [static]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
creates audio device
<p>
Use this method instead of a constructor. <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>nTracks</em>&nbsp;</td><td>(optional) the maximum number of sounds that are played parallely. Computation time is linearly correlated to this factor. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>frequency</em>&nbsp;</td><td>(optional) sample frequency of the playback in Hz. 22050 corresponds to FM radio 44100 is CD quality. Computation time is linearly correlated to this factor. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>chunkSize</em>&nbsp;</td><td>(optional) the number of bytes that are sent to the sound card at once. Low numbers lead to smaller latencies but need more computation time (thread switches). If a too small number is chosen, the sounds might not be played continuously. The default value 512 guarantees a good latency below 40 ms at 22050 Hz sample frequency. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>a pointer to an audio device object in case of success Note that the parameters are only handled when calling for the first time. Afterwards always the same object is returned until an explicit <a class="el" href="class_device_audio.html#e1">destroy()</a> is called.</dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="b2"></a><!-- doxytag: member=<DeviceAudioRt::mixOutputFloat> ref=<b2> args=<(signed short *outputBuffer, unsigned int nFrames)> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">int DeviceAudioRt::mixOutputFloat </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">signed short *&nbsp;</td>
<td class="mdname" nowrap> <em>outputBuffer</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>nFrames</em></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [protected]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
mixes tracks to a single output stream
<p>
</td>
</tr>
</table>
<a class="anchor" name="a2"></a><!-- doxytag: member=<DeviceAudioRt::sample> ref=<a2> args=<(unsigned int handle) const > --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual const <a class="el" href="class_audio_sample.html">AudioSample</a>* DeviceAudioRt::sample </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">unsigned int&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>handle</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap> const<code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
allows read access to a sample identified by its handle
<p>
<p>
Reimplemented from <a class="el" href="class_device_audio.html#a7">DeviceAudio</a>. </td>
</tr>
</table>
<a class="anchor" name="a1"></a><!-- doxytag: member=<DeviceAudioRt::sampleDestroy> ref=<a1> args=<(unsigned int sample)> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual bool DeviceAudioRt::sampleDestroy </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">unsigned int&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>sample</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
deletes a previously created sound sample resource identified by its handle
<p>
<p>
Implements <a class="el" href="class_device_audio.html#a6">DeviceAudio</a>. </td>
</tr>
</table>
<a class="anchor" name="a0"></a><!-- doxytag: member=<DeviceAudioRt::sampleFromMemory> ref=<a0> args=<(const AudioSample &amp;sample, float volume=1.0f)> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual unsigned int DeviceAudioRt::sampleFromMemory </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">const <a class="el" href="class_audio_sample.html">AudioSample</a> &amp;&nbsp;</td>
<td class="mdname" nowrap> <em>sample</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>volume</em> = <code>1.0f</code></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
converts a sound sample to internal audio format, returns handle
<p>
<p>
Implements <a class="el" href="class_device_audio.html#a5">DeviceAudio</a>. </td>
</tr>
</table>
<a class="anchor" name="a8"></a><!-- doxytag: member=<DeviceAudioRt::soundActive> ref=<a8> args=<() const > --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual unsigned DeviceAudioRt::soundActive </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap> const<code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
returns number of currently active sounds
<p>
<p>
Implements <a class="el" href="class_device_audio.html#a13">DeviceAudio</a>. </td>
</tr>
</table>
<a class="anchor" name="a4"></a><!-- doxytag: member=<DeviceAudioRt::soundLoop> ref=<a4> args=<(unsigned int sample, float volumeL=1.0f, float volumeR=1.0f, float disparity=0.0f, float pitch=1.0f)> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual unsigned int DeviceAudioRt::soundLoop </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>sample</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>volumeL</em> = <code>1.0f</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>volumeR</em> = <code>1.0f</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>disparity</em> = <code>0.0f</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>pitch</em> = <code>1.0f</code></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
plays a specified sample continuously and sets its parameters <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sample</em>&nbsp;</td><td>a sample handle returned by a previous load() call </td></tr>
<tr><td valign="top"></td><td valign="top"><em>volumeL</em>&nbsp;</td><td>(optional) left volume </td></tr>
<tr><td valign="top"></td><td valign="top"><em>volumeR</em>&nbsp;</td><td>(optional) right volume </td></tr>
<tr><td valign="top"></td><td valign="top"><em>disparity</em>&nbsp;</td><td>(optional) time difference between left and right channel in seconds. Use negative values to specify a delay for the left channel, positive for the right. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>pitch</em>&nbsp;</td><td>(optional) pitch factor for playback. 0.5 corresponds to one octave below, 2.0 to one above the original sample. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>a handle to the currently played sound or 0 in case of error </dd></dl>
<p>
Implements <a class="el" href="class_device_audio.html#a9">DeviceAudio</a>. </td>
</tr>
</table>
<a class="anchor" name="a3"></a><!-- doxytag: member=<DeviceAudioRt::soundPlay> ref=<a3> args=<(unsigned int sample, float volumeL=1.0f, float volumeR=1.0f, float disparity=0.0f, float pitch=1.0f)> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual unsigned int DeviceAudioRt::soundPlay </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>sample</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>volumeL</em> = <code>1.0f</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>volumeR</em> = <code>1.0f</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>disparity</em> = <code>0.0f</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>pitch</em> = <code>1.0f</code></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
plays a specified sample once and sets its parameters
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sample</em>&nbsp;</td><td>a sample handle returned by a previous load() call </td></tr>
<tr><td valign="top"></td><td valign="top"><em>volumeL</em>&nbsp;</td><td>(optional) left volume </td></tr>
<tr><td valign="top"></td><td valign="top"><em>volumeR</em>&nbsp;</td><td>(optional) right volume </td></tr>
<tr><td valign="top"></td><td valign="top"><em>disparity</em>&nbsp;</td><td>(optional) time difference between left and right channel in seconds. Use negative values to specify a delay for the left channel, positive for the right. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>pitch</em>&nbsp;</td><td>(optional) pitch factor for playback. 0.5 corresponds to one octave below, 2.0 to one above the original sample. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>a handle to the currently played sound or 0 in case of error </dd></dl>
<p>
Implements <a class="el" href="class_device_audio.html#a8">DeviceAudio</a>. </td>
</tr>
</table>
<a class="anchor" name="a7"></a><!-- doxytag: member=<DeviceAudioRt::soundStop> ref=<a7> args=<()> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual void DeviceAudioRt::soundStop </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
stops all sounds immediately
<p>
<p>
Implements <a class="el" href="class_device_audio.html#a12">DeviceAudio</a>. </td>
</tr>
</table>
<a class="anchor" name="a6"></a><!-- doxytag: member=<DeviceAudioRt::soundStop> ref=<a6> args=<(unsigned int sound)> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual bool DeviceAudioRt::soundStop </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">unsigned int&nbsp;</td>
<td class="mdname1" valign="top" nowrap> <em>sound</em> </td>
<td class="md" valign="top">&nbsp;)&nbsp;</td>
<td class="md" nowrap><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
stops a specified sound immediately
<p>
<p>
Implements <a class="el" href="class_device_audio.html#a11">DeviceAudio</a>. </td>
</tr>
</table>
<a class="anchor" name="a5"></a><!-- doxytag: member=<DeviceAudioRt::soundUpdate> ref=<a5> args=<(unsigned int sound, float volumeL, float volumeR, float disparity=0.0f, float pitch=1.0f)> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">virtual bool DeviceAudioRt::soundUpdate </td>
<td class="md" valign="top">(&nbsp;</td>
<td class="md" nowrap valign="top">unsigned int&nbsp;</td>
<td class="mdname" nowrap> <em>sound</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>volumeL</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>volumeR</em>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>disparity</em> = <code>0.0f</code>, </td>
</tr>
<tr>
<td class="md" nowrap align="right"></td>
<td class="md"></td>
<td class="md" nowrap>float&nbsp;</td>
<td class="mdname" nowrap> <em>pitch</em> = <code>1.0f</code></td>
</tr>
<tr>
<td class="md"></td>
<td class="md">)&nbsp;</td>
<td class="md" colspan="2"><code> [virtual]</code></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
updates parameters of a specified sound
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>sound</em>&nbsp;</td><td>handle of a currently active sound </td></tr>
<tr><td valign="top"></td><td valign="top"><em>volumeL</em>&nbsp;</td><td>left volume </td></tr>
<tr><td valign="top"></td><td valign="top"><em>volumeR</em>&nbsp;</td><td>right volume </td></tr>
<tr><td valign="top"></td><td valign="top"><em>disparity</em>&nbsp;</td><td>(optional) time difference between left and right channel in seconds. Use negative values to specify a delay for the left channel, positive for the right. </td></tr>
<tr><td valign="top"></td><td valign="top"><em>pitch</em>&nbsp;</td><td>(optional) pitch factor for playback. 0.5 corresponds to one octave below, 2.0 to one above the original sample. </td></tr>
</table>
</dl>
<dl compact><dt><b>Returns:</b></dt><dd>true in case the parameters have been updated successfully </dd></dl>
<p>
Implements <a class="el" href="class_device_audio.html#a10">DeviceAudio</a>. </td>
</tr>
</table>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="p4"></a><!-- doxytag: member=<DeviceAudioRt::m_dac> ref=<p4> args=<> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">RtAudio <a class="el" href="class_device_audio_rt.html#p4">DeviceAudioRt::m_dac</a><code> [protected]</code> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
audio manager
<p>
</td>
</tr>
</table>
<a class="anchor" name="p3"></a><!-- doxytag: member=<DeviceAudioRt::m_nSound> ref=<p3> args=<> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">unsigned int <a class="el" href="class_device_audio_rt.html#p3">DeviceAudioRt::m_nSound</a><code> [protected]</code> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
stores number of parallel sounds
<p>
</td>
</tr>
</table>
<a class="anchor" name="p1"></a><!-- doxytag: member=<DeviceAudioRt::m_sampleCounter> ref=<p1> args=<> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">unsigned int <a class="el" href="class_device_audio_rt.html#p1">DeviceAudioRt::m_sampleCounter</a><code> [protected]</code> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
stores maximum sample id
<p>
</td>
</tr>
</table>
<a class="anchor" name="p2"></a><!-- doxytag: member=<DeviceAudioRt::ma_sound> ref=<p2> args=<> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">_AudioTrack* <a class="el" href="class_device_audio_rt.html#p2">DeviceAudioRt::ma_sound</a><code> [protected]</code> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
stores sounds to be mixed
<p>
</td>
</tr>
</table>
<a class="anchor" name="p0"></a><!-- doxytag: member=<DeviceAudioRt::mm_sample> ref=<p0> args=<> --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top">std::map&lt;unsigned int, <a class="el" href="class_audio_sample.html">AudioSample</a>*&gt; <a class="el" href="class_device_audio_rt.html#p0">DeviceAudioRt::mm_sample</a><code> [protected]</code> </td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
<tr>
<td>
&nbsp;
</td>
<td>
<p>
stores loaded sound samples
<p>
</td>
</tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="pro_audio_rt_8h-source.html">proAudioRt.h</a></ul>
<div style="border-width: 1px; border-top-color: gray; border-top-style: solid; margin: 2em 0 0 0;">
<table cols="2" width="100%" border="0"><tr>
<td style = "text-align: left; font-size: 75%; padding: 0em 2em;">
&copy; 2009-02-04 by Gerald Franz, www.viremo.de
</td>
<td style = "text-align: right; font-size: 75%; padding: 0em 2em;">
<a href="../impressum.html">impressum</a>
</td>
</tr></table>
</div>
</body>
</html>