Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

535 lines
39KB

  1. <HTML>
  2. <HEAD>
  3. <TITLE>The RtAudio Home Page</TITLE>
  4. <LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
  5. <LINK REL="SHORTCUT ICON" HREF="http://www.music.mcgill.ca/~gary/favicon.ico">
  6. </HEAD>
  7. <BODY BGCOLOR="#FFFFFF">
  8. <CENTER>
  9. <a class="qindex" href="index.html">Home</a> &nbsp; <a class="qindex" href="annotated.html">Class/Enum List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </CENTER>
  10. <HR>
  11. <!-- Generated by Doxygen 1.6.2 -->
  12. <div class="contents">
  13. <h1>RtAudio Class Reference</h1><!-- doxytag: class="RtAudio" -->
  14. <p>Realtime audio i/o C++ classes.
  15. <a href="#_details">More...</a></p>
  16. <p><code>#include &lt;<a class="el" href="RtAudio_8h_source.html">RtAudio.h</a>&gt;</code></p>
  17. <p><a href="classRtAudio-members.html">List of all members.</a></p>
  18. <table border="0" cellpadding="0" cellspacing="0">
  19. <tr><td colspan="2"><h2>Classes</h2></td></tr>
  20. <tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1DeviceInfo.html">DeviceInfo</a></td></tr>
  21. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The public device information structure for returning queried values. <a href="structRtAudio_1_1DeviceInfo.html#_details">More...</a><br/></td></tr>
  22. <tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1StreamOptions.html">StreamOptions</a></td></tr>
  23. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The structure for specifying stream options. <a href="structRtAudio_1_1StreamOptions.html#_details">More...</a><br/></td></tr>
  24. <tr><td class="memItemLeft" align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1StreamParameters.html">StreamParameters</a></td></tr>
  25. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The structure for specifying input or ouput stream parameters. <a href="structRtAudio_1_1StreamParameters.html#_details">More...</a><br/></td></tr>
  26. <tr><td colspan="2"><h2>Public Types</h2></td></tr>
  27. <tr><td class="memItemLeft" align="right" valign="top">enum &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849">Api</a> { <br/>
  28. &nbsp;&nbsp;<a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849aa49af3ac767106158bc6cad74fb214ae">UNSPECIFIED</a>,
  29. <a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849aa7a2ba095c2806caa893b6fb8fc3a1a8">LINUX_ALSA</a>,
  30. <a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849adc17dff310e85d303fb326c837c08d77">LINUX_PULSE</a>,
  31. <a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a39c84615e61de75e6a4e865596d62c82">LINUX_OSS</a>,
  32. <br/>
  33. &nbsp;&nbsp;<a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a4767e17c6edfbd827f91763915df4105">UNIX_JACK</a>,
  34. <a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a9fec92b8272244a87a6a11a717bd662d">MACOSX_CORE</a>,
  35. <a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a219517d1df90f94d07758481155bd469">WINDOWS_ASIO</a>,
  36. <a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849a28478830f42c2fd61e6c7ad498901931">WINDOWS_DS</a>,
  37. <br/>
  38. &nbsp;&nbsp;<a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849ab06b8fd88bf18c9a2b8271f6961ae2d1">RTAUDIO_DUMMY</a>
  39. <br/>
  40. }</td></tr>
  41. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight"><p>Audio API specifier arguments. </p>
  42. <a href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849">More...</a><br/></td></tr>
  43. <tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
  44. <tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#afd0bfa26deae9804e18faff59d0273d9">RtAudio</a> (<a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849">RtAudio::Api</a> api=UNSPECIFIED) throw ()</td></tr>
  45. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The class constructor. <a href="#afd0bfa26deae9804e18faff59d0273d9"></a><br/></td></tr>
  46. <tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#aa8a9716fd64680657ef69c9465442a2f">~RtAudio</a> () throw ()</td></tr>
  47. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The destructor. <a href="#aa8a9716fd64680657ef69c9465442a2f"></a><br/></td></tr>
  48. <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a83687634795792b2c47e4ae1cf8a5246"></a><!-- doxytag: member="RtAudio::getCurrentApi" ref="a83687634795792b2c47e4ae1cf8a5246" args="(void)" -->
  49. <a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849">RtAudio::Api</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a83687634795792b2c47e4ae1cf8a5246">getCurrentApi</a> (void) throw ()</td></tr>
  50. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the audio API specifier for the current instance of <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>. <br/></td></tr>
  51. <tr><td class="memItemLeft" align="right" valign="top">unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a">getDeviceCount</a> (void) throw ()</td></tr>
  52. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A public function that queries for the number of audio devices available. <a href="#a747ce2d73803641bbb66d6e78092aa1a"></a><br/></td></tr>
  53. <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="structRtAudio_1_1DeviceInfo.html">RtAudio::DeviceInfo</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a02d7ff44ad1d7eae22283a052f3dfda8">getDeviceInfo</a> (unsigned int device)</td></tr>
  54. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return an <a class="el" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> structure for a specified device number. <a href="#a02d7ff44ad1d7eae22283a052f3dfda8"></a><br/></td></tr>
  55. <tr><td class="memItemLeft" align="right" valign="top">unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a3a3f3dbe13ea696b521e49cdaaa357bc">getDefaultOutputDevice</a> (void) throw ()</td></tr>
  56. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A function that returns the index of the default output device. <a href="#a3a3f3dbe13ea696b521e49cdaaa357bc"></a><br/></td></tr>
  57. <tr><td class="memItemLeft" align="right" valign="top">unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#aad8b94edd3cd379ee300b125750ac6ce">getDefaultInputDevice</a> (void) throw ()</td></tr>
  58. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A function that returns the index of the default input device. <a href="#aad8b94edd3cd379ee300b125750ac6ce"></a><br/></td></tr>
  59. <tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#afacc99740fa4c5606fb35467cdea6da8">openStream</a> (<a class="el" href="structRtAudio_1_1StreamParameters.html">RtAudio::StreamParameters</a> *outputParameters, <a class="el" href="structRtAudio_1_1StreamParameters.html">RtAudio::StreamParameters</a> *inputParameters, <a class="el" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8">RtAudioFormat</a> format, unsigned int sampleRate, unsigned int *bufferFrames, <a class="el" href="RtAudio_8h.html#a112c7b7e25a974977f6fc094cef1a31f">RtAudioCallback</a> callback, void *userData=NULL, <a class="el" href="structRtAudio_1_1StreamOptions.html">RtAudio::StreamOptions</a> *options=NULL)</td></tr>
  60. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A public function for opening a stream with the specified parameters. <a href="#afacc99740fa4c5606fb35467cdea6da8"></a><br/></td></tr>
  61. <tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a90d599002ad32cf250a4cb866f2cc93a">closeStream</a> (void) throw ()</td></tr>
  62. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A function that closes a stream and frees any associated stream memory. <a href="#a90d599002ad32cf250a4cb866f2cc93a"></a><br/></td></tr>
  63. <tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#aec017a89629ccef66a90b60be22a2f80">startStream</a> (void)</td></tr>
  64. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A function that starts a stream. <a href="#aec017a89629ccef66a90b60be22a2f80"></a><br/></td></tr>
  65. <tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#af4c241ff86936ecc8108f0d9dfe3efdd">stopStream</a> (void)</td></tr>
  66. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Stop a stream, allowing any samples remaining in the output queue to be played. <a href="#af4c241ff86936ecc8108f0d9dfe3efdd"></a><br/></td></tr>
  67. <tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#ad0586b47cd6bb9591a80b4052815991f">abortStream</a> (void)</td></tr>
  68. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Stop a stream, discarding any samples remaining in the input/output queue. <a href="#ad0586b47cd6bb9591a80b4052815991f"></a><br/></td></tr>
  69. <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3863e45ff81dbe97176de0ee7545917f"></a><!-- doxytag: member="RtAudio::isStreamOpen" ref="a3863e45ff81dbe97176de0ee7545917f" args="(void) const " -->
  70. bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a3863e45ff81dbe97176de0ee7545917f">isStreamOpen</a> (void) const throw ()</td></tr>
  71. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true if a stream is open and false if not. <br/></td></tr>
  72. <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a84cc8d9b7ab9bc5f37bcf48430ec5aea"></a><!-- doxytag: member="RtAudio::isStreamRunning" ref="a84cc8d9b7ab9bc5f37bcf48430ec5aea" args="(void) const " -->
  73. bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a84cc8d9b7ab9bc5f37bcf48430ec5aea">isStreamRunning</a> (void) const throw ()</td></tr>
  74. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true if the stream is running and false if it is stopped or not open. <br/></td></tr>
  75. <tr><td class="memItemLeft" align="right" valign="top">double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a344e59a62353c5791db4621b985cb2ca">getStreamTime</a> (void)</td></tr>
  76. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the number of elapsed seconds since the stream was started. <a href="#a344e59a62353c5791db4621b985cb2ca"></a><br/></td></tr>
  77. <tr><td class="memItemLeft" align="right" valign="top">long&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a843c989d9f501c71bc2f2c5ca18df9f3">getStreamLatency</a> (void)</td></tr>
  78. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the internal stream latency in sample frames. <a href="#a843c989d9f501c71bc2f2c5ca18df9f3"></a><br/></td></tr>
  79. <tr><td class="memItemLeft" align="right" valign="top">unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a28214b8b05d60b45c24ee6fae7b2a0b5">getStreamSampleRate</a> (void)</td></tr>
  80. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns actual sample rate in use by the stream. <a href="#a28214b8b05d60b45c24ee6fae7b2a0b5"></a><br/></td></tr>
  81. <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af0752ee51cce3dd90a3bd009f9fdbe77"></a><!-- doxytag: member="RtAudio::showWarnings" ref="af0752ee51cce3dd90a3bd009f9fdbe77" args="(bool value=true)" -->
  82. void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#af0752ee51cce3dd90a3bd009f9fdbe77">showWarnings</a> (bool value=true) throw ()</td></tr>
  83. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Specify whether warning messages should be printed to stderr. <br/></td></tr>
  84. <tr><td colspan="2"><h2>Static Public Member Functions</h2></td></tr>
  85. <tr><td class="memItemLeft" align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#ae266ffad2ef428d0b2c6c262d391ce26">getCompiledApi</a> (std::vector&lt; <a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849">RtAudio::Api</a> &gt; &amp;apis) throw ()</td></tr>
  86. <tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A static function to determine the available compiled audio APIs. <a href="#ae266ffad2ef428d0b2c6c262d391ce26"></a><br/></td></tr>
  87. </table>
  88. <hr/><a name="_details"></a><h2>Detailed Description</h2>
  89. <p>Realtime audio i/o C++ classes. </p>
  90. <p><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> provides a common API (Application Programming Interface) for realtime audio input/output across Linux (native ALSA, Jack, and OSS), Macintosh OS X (CoreAudio and Jack), and Windows (DirectSound and ASIO) operating systems.</p>
  91. <p><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> WWW site: <a href="http://www.music.mcgill.ca/~gary/rtaudio/">http://www.music.mcgill.ca/~gary/rtaudio/</a></p>
  92. <p><a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a>: realtime audio i/o C++ classes Copyright (c) 2001-2012 Gary P. Scavone</p>
  93. <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>
  94. <p>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.</p>
  95. <p>Any person wishing to distribute modifications to the Software is asked to send the modifications to the original developer so that they can be incorporated into the canonical version. This is, however, not a binding provision of this license.</p>
  96. <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>
  97. <hr/><h2>Member Enumeration Documentation</h2>
  98. <a class="anchor" id="ac9b6f625da88249d08a8409a9db0d849"></a><!-- doxytag: member="RtAudio::Api" ref="ac9b6f625da88249d08a8409a9db0d849" args="" -->
  99. <div class="memitem">
  100. <div class="memproto">
  101. <table class="memname">
  102. <tr>
  103. <td class="memname">enum <a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849">RtAudio::Api</a></td>
  104. </tr>
  105. </table>
  106. </div>
  107. <div class="memdoc">
  108. <p>Audio API specifier arguments. </p>
  109. <dl><dt><b>Enumerator: </b></dt><dd><table border="0" cellspacing="2" cellpadding="0">
  110. <tr><td valign="top"><em><a class="anchor" id="ac9b6f625da88249d08a8409a9db0d849aa49af3ac767106158bc6cad74fb214ae"></a><!-- doxytag: member="UNSPECIFIED" ref="ac9b6f625da88249d08a8409a9db0d849aa49af3ac767106158bc6cad74fb214ae" args="" -->UNSPECIFIED</em>&nbsp;</td><td>
  111. <p>Search for a working compiled API. </p>
  112. </td></tr>
  113. <tr><td valign="top"><em><a class="anchor" id="ac9b6f625da88249d08a8409a9db0d849aa7a2ba095c2806caa893b6fb8fc3a1a8"></a><!-- doxytag: member="LINUX_ALSA" ref="ac9b6f625da88249d08a8409a9db0d849aa7a2ba095c2806caa893b6fb8fc3a1a8" args="" -->LINUX_ALSA</em>&nbsp;</td><td>
  114. <p>The Advanced Linux Sound Architecture API. </p>
  115. </td></tr>
  116. <tr><td valign="top"><em><a class="anchor" id="ac9b6f625da88249d08a8409a9db0d849adc17dff310e85d303fb326c837c08d77"></a><!-- doxytag: member="LINUX_PULSE" ref="ac9b6f625da88249d08a8409a9db0d849adc17dff310e85d303fb326c837c08d77" args="" -->LINUX_PULSE</em>&nbsp;</td><td>
  117. <p>The Linux PulseAudio API. </p>
  118. </td></tr>
  119. <tr><td valign="top"><em><a class="anchor" id="ac9b6f625da88249d08a8409a9db0d849a39c84615e61de75e6a4e865596d62c82"></a><!-- doxytag: member="LINUX_OSS" ref="ac9b6f625da88249d08a8409a9db0d849a39c84615e61de75e6a4e865596d62c82" args="" -->LINUX_OSS</em>&nbsp;</td><td>
  120. <p>The Linux Open Sound System API. </p>
  121. </td></tr>
  122. <tr><td valign="top"><em><a class="anchor" id="ac9b6f625da88249d08a8409a9db0d849a4767e17c6edfbd827f91763915df4105"></a><!-- doxytag: member="UNIX_JACK" ref="ac9b6f625da88249d08a8409a9db0d849a4767e17c6edfbd827f91763915df4105" args="" -->UNIX_JACK</em>&nbsp;</td><td>
  123. <p>The Jack Low-Latency Audio Server API. </p>
  124. </td></tr>
  125. <tr><td valign="top"><em><a class="anchor" id="ac9b6f625da88249d08a8409a9db0d849a9fec92b8272244a87a6a11a717bd662d"></a><!-- doxytag: member="MACOSX_CORE" ref="ac9b6f625da88249d08a8409a9db0d849a9fec92b8272244a87a6a11a717bd662d" args="" -->MACOSX_CORE</em>&nbsp;</td><td>
  126. <p>Macintosh OS-X Core Audio API. </p>
  127. </td></tr>
  128. <tr><td valign="top"><em><a class="anchor" id="ac9b6f625da88249d08a8409a9db0d849a219517d1df90f94d07758481155bd469"></a><!-- doxytag: member="WINDOWS_ASIO" ref="ac9b6f625da88249d08a8409a9db0d849a219517d1df90f94d07758481155bd469" args="" -->WINDOWS_ASIO</em>&nbsp;</td><td>
  129. <p>The Steinberg Audio Stream I/O API. </p>
  130. </td></tr>
  131. <tr><td valign="top"><em><a class="anchor" id="ac9b6f625da88249d08a8409a9db0d849a28478830f42c2fd61e6c7ad498901931"></a><!-- doxytag: member="WINDOWS_DS" ref="ac9b6f625da88249d08a8409a9db0d849a28478830f42c2fd61e6c7ad498901931" args="" -->WINDOWS_DS</em>&nbsp;</td><td>
  132. <p>The Microsoft Direct Sound API. </p>
  133. </td></tr>
  134. <tr><td valign="top"><em><a class="anchor" id="ac9b6f625da88249d08a8409a9db0d849ab06b8fd88bf18c9a2b8271f6961ae2d1"></a><!-- doxytag: member="RTAUDIO_DUMMY" ref="ac9b6f625da88249d08a8409a9db0d849ab06b8fd88bf18c9a2b8271f6961ae2d1" args="" -->RTAUDIO_DUMMY</em>&nbsp;</td><td>
  135. <p>A compilable but non-functional API. </p>
  136. </td></tr>
  137. </table>
  138. </dd>
  139. </dl>
  140. </div>
  141. </div>
  142. <hr/><h2>Constructor &amp; Destructor Documentation</h2>
  143. <a class="anchor" id="afd0bfa26deae9804e18faff59d0273d9"></a><!-- doxytag: member="RtAudio::RtAudio" ref="afd0bfa26deae9804e18faff59d0273d9" args="(RtAudio::Api api=UNSPECIFIED)" -->
  144. <div class="memitem">
  145. <div class="memproto">
  146. <table class="memname">
  147. <tr>
  148. <td class="memname">RtAudio::RtAudio </td>
  149. <td>(</td>
  150. <td class="paramtype"><a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849">RtAudio::Api</a>&nbsp;</td>
  151. <td class="paramname"> <em>api</em> = <code>UNSPECIFIED</code></td>
  152. <td>&nbsp;)&nbsp;</td>
  153. <td> throw ()</td>
  154. </tr>
  155. </table>
  156. </div>
  157. <div class="memdoc">
  158. <p>The class constructor. </p>
  159. <p>The constructor performs minor initialization tasks. No exceptions can be thrown.</p>
  160. <p>If no API argument is specified and multiple API support has been compiled, the default order of use is JACK, ALSA, OSS (Linux systems) and ASIO, DS (Windows systems). </p>
  161. </div>
  162. </div>
  163. <a class="anchor" id="aa8a9716fd64680657ef69c9465442a2f"></a><!-- doxytag: member="RtAudio::~RtAudio" ref="aa8a9716fd64680657ef69c9465442a2f" args="()" -->
  164. <div class="memitem">
  165. <div class="memproto">
  166. <table class="memname">
  167. <tr>
  168. <td class="memname">RtAudio::~RtAudio </td>
  169. <td>(</td>
  170. <td class="paramname"></td>
  171. <td>&nbsp;)&nbsp;</td>
  172. <td> throw ()</td>
  173. </tr>
  174. </table>
  175. </div>
  176. <div class="memdoc">
  177. <p>The destructor. </p>
  178. <p>If a stream is running or open, it will be stopped and closed automatically. </p>
  179. </div>
  180. </div>
  181. <hr/><h2>Member Function Documentation</h2>
  182. <a class="anchor" id="ae266ffad2ef428d0b2c6c262d391ce26"></a><!-- doxytag: member="RtAudio::getCompiledApi" ref="ae266ffad2ef428d0b2c6c262d391ce26" args="(std::vector&lt; RtAudio::Api &gt; &amp;apis)" -->
  183. <div class="memitem">
  184. <div class="memproto">
  185. <table class="memname">
  186. <tr>
  187. <td class="memname">static void RtAudio::getCompiledApi </td>
  188. <td>(</td>
  189. <td class="paramtype">std::vector&lt; <a class="el" href="classRtAudio.html#ac9b6f625da88249d08a8409a9db0d849">RtAudio::Api</a> &gt; &amp;&nbsp;</td>
  190. <td class="paramname"> <em>apis</em></td>
  191. <td>&nbsp;)&nbsp;</td>
  192. <td> throw ()<code> [static]</code></td>
  193. </tr>
  194. </table>
  195. </div>
  196. <div class="memdoc">
  197. <p>A static function to determine the available compiled audio APIs. </p>
  198. <p>The values returned in the std::vector can be compared against the enumerated list values. Note that there can be more than one API compiled for certain operating systems. </p>
  199. </div>
  200. </div>
  201. <a class="anchor" id="a747ce2d73803641bbb66d6e78092aa1a"></a><!-- doxytag: member="RtAudio::getDeviceCount" ref="a747ce2d73803641bbb66d6e78092aa1a" args="(void)" -->
  202. <div class="memitem">
  203. <div class="memproto">
  204. <table class="memname">
  205. <tr>
  206. <td class="memname">unsigned int RtAudio::getDeviceCount </td>
  207. <td>(</td>
  208. <td class="paramtype">void&nbsp;</td>
  209. <td class="paramname"></td>
  210. <td>&nbsp;)&nbsp;</td>
  211. <td> throw ()<code> [inline]</code></td>
  212. </tr>
  213. </table>
  214. </div>
  215. <div class="memdoc">
  216. <p>A public function that queries for the number of audio devices available. </p>
  217. <p>This function performs a system query of available devices each time it is called, thus supporting devices connected <em>after</em> instantiation. If a system error occurs during processing, a warning will be issued. </p>
  218. </div>
  219. </div>
  220. <a class="anchor" id="a02d7ff44ad1d7eae22283a052f3dfda8"></a><!-- doxytag: member="RtAudio::getDeviceInfo" ref="a02d7ff44ad1d7eae22283a052f3dfda8" args="(unsigned int device)" -->
  221. <div class="memitem">
  222. <div class="memproto">
  223. <table class="memname">
  224. <tr>
  225. <td class="memname"><a class="el" href="structRtAudio_1_1DeviceInfo.html">RtAudio::DeviceInfo</a> RtAudio::getDeviceInfo </td>
  226. <td>(</td>
  227. <td class="paramtype">unsigned int&nbsp;</td>
  228. <td class="paramname"> <em>device</em></td>
  229. <td>&nbsp;)&nbsp;</td>
  230. <td><code> [inline]</code></td>
  231. </tr>
  232. </table>
  233. </div>
  234. <div class="memdoc">
  235. <p>Return an <a class="el" href="structRtAudio_1_1DeviceInfo.html" title="The public device information structure for returning queried values.">RtAudio::DeviceInfo</a> structure for a specified device number. </p>
  236. <p>Any device integer between 0 and <a class="el" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a" title="A public function that queries for the number of audio devices available.">getDeviceCount()</a> - 1 is valid. If an invalid argument is provided, an <a class="el" href="classRtError.html" title="Exception handling class for RtAudio &amp; RtMidi.">RtError</a> (type = INVALID_USE) will be thrown. 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 corresponding "isDefault" member will have a value of "true". </p>
  237. </div>
  238. </div>
  239. <a class="anchor" id="a3a3f3dbe13ea696b521e49cdaaa357bc"></a><!-- doxytag: member="RtAudio::getDefaultOutputDevice" ref="a3a3f3dbe13ea696b521e49cdaaa357bc" args="(void)" -->
  240. <div class="memitem">
  241. <div class="memproto">
  242. <table class="memname">
  243. <tr>
  244. <td class="memname">unsigned int RtAudio::getDefaultOutputDevice </td>
  245. <td>(</td>
  246. <td class="paramtype">void&nbsp;</td>
  247. <td class="paramname"></td>
  248. <td>&nbsp;)&nbsp;</td>
  249. <td> throw ()<code> [inline]</code></td>
  250. </tr>
  251. </table>
  252. </div>
  253. <div class="memdoc">
  254. <p>A function that returns the index of the default output device. </p>
  255. <p>If the underlying audio API does not provide a "default
  256. device", or if no devices are available, the return value will be 0. Note that this is a valid device identifier and it is the client's responsibility to verify that a device is available before attempting to open a stream. </p>
  257. </div>
  258. </div>
  259. <a class="anchor" id="aad8b94edd3cd379ee300b125750ac6ce"></a><!-- doxytag: member="RtAudio::getDefaultInputDevice" ref="aad8b94edd3cd379ee300b125750ac6ce" args="(void)" -->
  260. <div class="memitem">
  261. <div class="memproto">
  262. <table class="memname">
  263. <tr>
  264. <td class="memname">unsigned int RtAudio::getDefaultInputDevice </td>
  265. <td>(</td>
  266. <td class="paramtype">void&nbsp;</td>
  267. <td class="paramname"></td>
  268. <td>&nbsp;)&nbsp;</td>
  269. <td> throw ()<code> [inline]</code></td>
  270. </tr>
  271. </table>
  272. </div>
  273. <div class="memdoc">
  274. <p>A function that returns the index of the default input device. </p>
  275. <p>If the underlying audio API does not provide a "default
  276. device", or if no devices are available, the return value will be 0. Note that this is a valid device identifier and it is the client's responsibility to verify that a device is available before attempting to open a stream. </p>
  277. </div>
  278. </div>
  279. <a class="anchor" id="afacc99740fa4c5606fb35467cdea6da8"></a><!-- doxytag: member="RtAudio::openStream" ref="afacc99740fa4c5606fb35467cdea6da8" args="(RtAudio::StreamParameters *outputParameters, RtAudio::StreamParameters *inputParameters, RtAudioFormat format, unsigned int sampleRate, unsigned int *bufferFrames, RtAudioCallback callback, void *userData=NULL, RtAudio::StreamOptions *options=NULL)" -->
  280. <div class="memitem">
  281. <div class="memproto">
  282. <table class="memname">
  283. <tr>
  284. <td class="memname">void RtAudio::openStream </td>
  285. <td>(</td>
  286. <td class="paramtype"><a class="el" href="structRtAudio_1_1StreamParameters.html">RtAudio::StreamParameters</a> *&nbsp;</td>
  287. <td class="paramname"> <em>outputParameters</em>, </td>
  288. </tr>
  289. <tr>
  290. <td class="paramkey"></td>
  291. <td></td>
  292. <td class="paramtype"><a class="el" href="structRtAudio_1_1StreamParameters.html">RtAudio::StreamParameters</a> *&nbsp;</td>
  293. <td class="paramname"> <em>inputParameters</em>, </td>
  294. </tr>
  295. <tr>
  296. <td class="paramkey"></td>
  297. <td></td>
  298. <td class="paramtype"><a class="el" href="RtAudio_8h.html#aafca92882d25915560018873221e44b8">RtAudioFormat</a>&nbsp;</td>
  299. <td class="paramname"> <em>format</em>, </td>
  300. </tr>
  301. <tr>
  302. <td class="paramkey"></td>
  303. <td></td>
  304. <td class="paramtype">unsigned int&nbsp;</td>
  305. <td class="paramname"> <em>sampleRate</em>, </td>
  306. </tr>
  307. <tr>
  308. <td class="paramkey"></td>
  309. <td></td>
  310. <td class="paramtype">unsigned int *&nbsp;</td>
  311. <td class="paramname"> <em>bufferFrames</em>, </td>
  312. </tr>
  313. <tr>
  314. <td class="paramkey"></td>
  315. <td></td>
  316. <td class="paramtype"><a class="el" href="RtAudio_8h.html#a112c7b7e25a974977f6fc094cef1a31f">RtAudioCallback</a>&nbsp;</td>
  317. <td class="paramname"> <em>callback</em>, </td>
  318. </tr>
  319. <tr>
  320. <td class="paramkey"></td>
  321. <td></td>
  322. <td class="paramtype">void *&nbsp;</td>
  323. <td class="paramname"> <em>userData</em> = <code>NULL</code>, </td>
  324. </tr>
  325. <tr>
  326. <td class="paramkey"></td>
  327. <td></td>
  328. <td class="paramtype"><a class="el" href="structRtAudio_1_1StreamOptions.html">RtAudio::StreamOptions</a> *&nbsp;</td>
  329. <td class="paramname"> <em>options</em> = <code>NULL</code></td><td>&nbsp;</td>
  330. </tr>
  331. <tr>
  332. <td></td>
  333. <td>)</td>
  334. <td></td><td></td><td></td>
  335. </tr>
  336. </table>
  337. </div>
  338. <div class="memdoc">
  339. <p>A public function for opening a stream with the specified parameters. </p>
  340. <p>An <a class="el" href="classRtError.html" title="Exception handling class for RtAudio &amp; RtMidi.">RtError</a> (type = SYSTEM_ERROR) is thrown if a stream cannot be opened with the specified parameters or an error occurs during processing. An <a class="el" href="classRtError.html" title="Exception handling class for RtAudio &amp; RtMidi.">RtError</a> (type = INVALID_USE) is thrown if any invalid device ID or channel number parameters are specified.</p>
  341. <dl><dt><b>Parameters:</b></dt><dd>
  342. <table border="0" cellspacing="2" cellpadding="0">
  343. <tr><td valign="top"></td><td valign="top"><em>outputParameters</em>&nbsp;</td><td>Specifies output stream parameters to use when opening a stream, including a device ID, number of channels, and starting channel number. For input-only streams, this argument should be NULL. The device ID is an index value between 0 and <a class="el" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a" title="A public function that queries for the number of audio devices available.">getDeviceCount()</a> - 1. </td></tr>
  344. <tr><td valign="top"></td><td valign="top"><em>inputParameters</em>&nbsp;</td><td>Specifies input stream parameters to use when opening a stream, including a device ID, number of channels, and starting channel number. For output-only streams, this argument should be NULL. The device ID is an index value between 0 and <a class="el" href="classRtAudio.html#a747ce2d73803641bbb66d6e78092aa1a" title="A public function that queries for the number of audio devices available.">getDeviceCount()</a> - 1. </td></tr>
  345. <tr><td valign="top"></td><td valign="top"><em>format</em>&nbsp;</td><td>An RtAudioFormat specifying the desired sample data format. </td></tr>
  346. <tr><td valign="top"></td><td valign="top"><em>sampleRate</em>&nbsp;</td><td>The desired sample rate (sample frames per second). </td></tr>
  347. <tr><td valign="top"></td><td valign="top"><em>*bufferFrames</em>&nbsp;</td><td>A pointer to a 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>
  348. <tr><td valign="top"></td><td valign="top"><em>callback</em>&nbsp;</td><td>A client-defined function that will be invoked when input data is available and/or output data is needed. </td></tr>
  349. <tr><td valign="top"></td><td valign="top"><em>userData</em>&nbsp;</td><td>An optional pointer to data that can be accessed from within the callback function. </td></tr>
  350. <tr><td valign="top"></td><td valign="top"><em>options</em>&nbsp;</td><td>An optional pointer to a structure containing various global stream options, including a list of OR'ed RtAudioStreamFlags and a suggested number of stream buffers that can be used to control stream latency. More buffers typically result in more robust performance, though at a cost of greater latency. If a value of zero is specified, a system-specific median value is chosen. If the RTAUDIO_MINIMIZE_LATENCY flag bit is set, the lowest allowable value is used. The actual value used is returned via the structure argument. The parameter is API dependent. </td></tr>
  351. </table>
  352. </dd>
  353. </dl>
  354. </div>
  355. </div>
  356. <a class="anchor" id="a90d599002ad32cf250a4cb866f2cc93a"></a><!-- doxytag: member="RtAudio::closeStream" ref="a90d599002ad32cf250a4cb866f2cc93a" args="(void)" -->
  357. <div class="memitem">
  358. <div class="memproto">
  359. <table class="memname">
  360. <tr>
  361. <td class="memname">void RtAudio::closeStream </td>
  362. <td>(</td>
  363. <td class="paramtype">void&nbsp;</td>
  364. <td class="paramname"></td>
  365. <td>&nbsp;)&nbsp;</td>
  366. <td> throw ()<code> [inline]</code></td>
  367. </tr>
  368. </table>
  369. </div>
  370. <div class="memdoc">
  371. <p>A function that closes a stream and frees any associated stream memory. </p>
  372. <p>If a stream is not open, this function issues a warning and returns (no exception is thrown). </p>
  373. </div>
  374. </div>
  375. <a class="anchor" id="aec017a89629ccef66a90b60be22a2f80"></a><!-- doxytag: member="RtAudio::startStream" ref="aec017a89629ccef66a90b60be22a2f80" args="(void)" -->
  376. <div class="memitem">
  377. <div class="memproto">
  378. <table class="memname">
  379. <tr>
  380. <td class="memname">void RtAudio::startStream </td>
  381. <td>(</td>
  382. <td class="paramtype">void&nbsp;</td>
  383. <td class="paramname"></td>
  384. <td>&nbsp;)&nbsp;</td>
  385. <td><code> [inline]</code></td>
  386. </tr>
  387. </table>
  388. </div>
  389. <div class="memdoc">
  390. <p>A function that starts a stream. </p>
  391. <p>An <a class="el" href="classRtError.html" title="Exception handling class for RtAudio &amp; RtMidi.">RtError</a> (type = SYSTEM_ERROR) is thrown if an error occurs during processing. An <a class="el" href="classRtError.html" title="Exception handling class for RtAudio &amp; RtMidi.">RtError</a> (type = INVALID_USE) is thrown if a stream is not open. A warning is issued if the stream is already running. </p>
  392. </div>
  393. </div>
  394. <a class="anchor" id="af4c241ff86936ecc8108f0d9dfe3efdd"></a><!-- doxytag: member="RtAudio::stopStream" ref="af4c241ff86936ecc8108f0d9dfe3efdd" args="(void)" -->
  395. <div class="memitem">
  396. <div class="memproto">
  397. <table class="memname">
  398. <tr>
  399. <td class="memname">void RtAudio::stopStream </td>
  400. <td>(</td>
  401. <td class="paramtype">void&nbsp;</td>
  402. <td class="paramname"></td>
  403. <td>&nbsp;)&nbsp;</td>
  404. <td><code> [inline]</code></td>
  405. </tr>
  406. </table>
  407. </div>
  408. <div class="memdoc">
  409. <p>Stop a stream, allowing any samples remaining in the output queue to be played. </p>
  410. <p>An <a class="el" href="classRtError.html" title="Exception handling class for RtAudio &amp; RtMidi.">RtError</a> (type = SYSTEM_ERROR) is thrown if an error occurs during processing. An <a class="el" href="classRtError.html" title="Exception handling class for RtAudio &amp; RtMidi.">RtError</a> (type = INVALID_USE) is thrown if a stream is not open. A warning is issued if the stream is already stopped. </p>
  411. </div>
  412. </div>
  413. <a class="anchor" id="ad0586b47cd6bb9591a80b4052815991f"></a><!-- doxytag: member="RtAudio::abortStream" ref="ad0586b47cd6bb9591a80b4052815991f" args="(void)" -->
  414. <div class="memitem">
  415. <div class="memproto">
  416. <table class="memname">
  417. <tr>
  418. <td class="memname">void RtAudio::abortStream </td>
  419. <td>(</td>
  420. <td class="paramtype">void&nbsp;</td>
  421. <td class="paramname"></td>
  422. <td>&nbsp;)&nbsp;</td>
  423. <td><code> [inline]</code></td>
  424. </tr>
  425. </table>
  426. </div>
  427. <div class="memdoc">
  428. <p>Stop a stream, discarding any samples remaining in the input/output queue. </p>
  429. <p>An <a class="el" href="classRtError.html" title="Exception handling class for RtAudio &amp; RtMidi.">RtError</a> (type = SYSTEM_ERROR) is thrown if an error occurs during processing. An <a class="el" href="classRtError.html" title="Exception handling class for RtAudio &amp; RtMidi.">RtError</a> (type = INVALID_USE) is thrown if a stream is not open. A warning is issued if the stream is already stopped. </p>
  430. </div>
  431. </div>
  432. <a class="anchor" id="a344e59a62353c5791db4621b985cb2ca"></a><!-- doxytag: member="RtAudio::getStreamTime" ref="a344e59a62353c5791db4621b985cb2ca" args="(void)" -->
  433. <div class="memitem">
  434. <div class="memproto">
  435. <table class="memname">
  436. <tr>
  437. <td class="memname">double RtAudio::getStreamTime </td>
  438. <td>(</td>
  439. <td class="paramtype">void&nbsp;</td>
  440. <td class="paramname"></td>
  441. <td>&nbsp;)&nbsp;</td>
  442. <td><code> [inline]</code></td>
  443. </tr>
  444. </table>
  445. </div>
  446. <div class="memdoc">
  447. <p>Returns the number of elapsed seconds since the stream was started. </p>
  448. <p>If a stream is not open, an <a class="el" href="classRtError.html" title="Exception handling class for RtAudio &amp; RtMidi.">RtError</a> (type = INVALID_USE) will be thrown. </p>
  449. </div>
  450. </div>
  451. <a class="anchor" id="a843c989d9f501c71bc2f2c5ca18df9f3"></a><!-- doxytag: member="RtAudio::getStreamLatency" ref="a843c989d9f501c71bc2f2c5ca18df9f3" args="(void)" -->
  452. <div class="memitem">
  453. <div class="memproto">
  454. <table class="memname">
  455. <tr>
  456. <td class="memname">long RtAudio::getStreamLatency </td>
  457. <td>(</td>
  458. <td class="paramtype">void&nbsp;</td>
  459. <td class="paramname"></td>
  460. <td>&nbsp;)&nbsp;</td>
  461. <td><code> [inline]</code></td>
  462. </tr>
  463. </table>
  464. </div>
  465. <div class="memdoc">
  466. <p>Returns the internal stream latency in sample frames. </p>
  467. <p>The stream latency refers to delay in audio input and/or output caused by internal buffering by the audio system and/or hardware. For duplex streams, the returned value will represent the sum of the input and output latencies. If a stream is not open, an <a class="el" href="classRtError.html" title="Exception handling class for RtAudio &amp; RtMidi.">RtError</a> (type = INVALID_USE) will be thrown. If the API does not report latency, the return value will be zero. </p>
  468. </div>
  469. </div>
  470. <a class="anchor" id="a28214b8b05d60b45c24ee6fae7b2a0b5"></a><!-- doxytag: member="RtAudio::getStreamSampleRate" ref="a28214b8b05d60b45c24ee6fae7b2a0b5" args="(void)" -->
  471. <div class="memitem">
  472. <div class="memproto">
  473. <table class="memname">
  474. <tr>
  475. <td class="memname">unsigned int RtAudio::getStreamSampleRate </td>
  476. <td>(</td>
  477. <td class="paramtype">void&nbsp;</td>
  478. <td class="paramname"></td>
  479. <td>&nbsp;)&nbsp;</td>
  480. <td><code> [inline]</code></td>
  481. </tr>
  482. </table>
  483. </div>
  484. <div class="memdoc">
  485. <p>Returns actual sample rate in use by the stream. </p>
  486. <p>On some systems, the sample rate used may be slightly different than that specified in the stream parameters. If a stream is not open, an <a class="el" href="classRtError.html" title="Exception handling class for RtAudio &amp; RtMidi.">RtError</a> (type = INVALID_USE) will be thrown. </p>
  487. </div>
  488. </div>
  489. <hr/>The documentation for this class was generated from the following file:<ul>
  490. <li><a class="el" href="RtAudio_8h_source.html">RtAudio.h</a></li>
  491. </ul>
  492. </div>
  493. <HR>
  494. <table><tr><td><img src="../images/mcgill.gif" width=165></td>
  495. <td>&copy;2001-2012 Gary P. Scavone, McGill University. All Rights Reserved.<br>Maintained by <a href="http://www.music.mcgill.ca/~gary/">Gary P. Scavone</a>.</td></tr>
  496. </table>
  497. </BODY>
  498. </HTML>