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.

919 lines
32KB

  1. <HTML>
  2. <HEAD>
  3. <TITLE>The RtAudio Tutorial</TITLE>
  4. <LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
  5. </HEAD>
  6. <BODY BGCOLOR="#FFFFFF">
  7. <CENTER>
  8. <a class="qindex" href="index.html">Tutorial</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>
  9. <HR>
  10. <!-- Generated by Doxygen 1.2.8.1 -->
  11. <h1>RtAudio Class Reference</h1><code>#include &lt;<a class="el" href="RtAudio_8h-source.html">RtAudio.h</a>&gt;</code>
  12. <p>
  13. <a href="classRtAudio-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
  14. <tr><td colspan=2><br><h2>Public Types</h2></td></tr>
  15. <tr><td nowrap align=right valign=top>typedef unsigned long&nbsp;</td><td valign=bottom><a class="el" href="classRtAudio.html#s0">RTAUDIO_FORMAT</a></td></tr>
  16. <tr><td nowrap align=right valign=top>typedef int (*&nbsp;</td><td valign=bottom><a class="el" href="classRtAudio.html#s1">RTAUDIO_CALLBACK</a> )(char *buffer, int bufferSize, void *userData)</td></tr>
  17. <tr><td nowrap align=right valign=top>enum &nbsp;</td><td valign=bottom>{ <a class="el" href="classRtAudio.html#s3s2">MAX_SAMPLE_RATES</a> = 14
  18. }</td></tr>
  19. <tr><td colspan=2><br><h2>Public Methods</h2></td></tr>
  20. <tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classRtAudio.html#a0">RtAudio</a> ()</td></tr>
  21. <tr><td>&nbsp;</td><td><font size=-1><em>The default constructor.</em> <a href="#a0">More...</a><em></em></font><br><br></td></tr>
  22. <tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classRtAudio.html#a1">RtAudio</a> (int *streamID, int outputDevice, int outputChannels, int inputDevice, int inputChannels, <a class="el" href="classRtAudio.html#s0">RTAUDIO_FORMAT</a> format, int sampleRate, int *bufferSize, int numberOfBuffers)</td></tr>
  23. <tr><td>&nbsp;</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>
  24. <tr><td nowrap align=right valign=top>&nbsp;</td><td valign=bottom><a class="el" href="classRtAudio.html#a2">~RtAudio</a> ()</td></tr>
  25. <tr><td>&nbsp;</td><td><font size=-1><em>The destructor.</em> <a href="#a2">More...</a><em></em></font><br><br></td></tr>
  26. <tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="classRtAudio.html#a3">openStream</a> (int outputDevice, int outputChannels, int inputDevice, int inputChannels, <a class="el" href="classRtAudio.html#s0">RTAUDIO_FORMAT</a> format, int sampleRate, int *bufferSize, int numberOfBuffers)</td></tr>
  27. <tr><td>&nbsp;</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>
  28. <tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classRtAudio.html#a4">setStreamCallback</a> (int streamID, <a class="el" href="classRtAudio.html#s1">RTAUDIO_CALLBACK</a> callback, void *userData)</td></tr>
  29. <tr><td>&nbsp;</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>
  30. <tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classRtAudio.html#a5">cancelStreamCallback</a> (int streamID)</td></tr>
  31. <tr><td>&nbsp;</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>
  32. <tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="classRtAudio.html#a6">getDeviceCount</a> (void)</td></tr>
  33. <tr><td>&nbsp;</td><td><font size=-1><em>A public method which returns the number of audio devices found.</em> <a href="#a6">More...</a><em></em></font><br><br></td></tr>
  34. <tr><td nowrap align=right valign=top>void&nbsp;</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>
  35. <tr><td>&nbsp;</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.</em> <a href="#a7">More...</a><em></em></font><br><br></td></tr>
  36. <tr><td nowrap align=right valign=top>char* const&nbsp;</td><td valign=bottom><a class="el" href="classRtAudio.html#a8">getStreamBuffer</a> (int streamID)</td></tr>
  37. <tr><td>&nbsp;</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>
  38. <tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classRtAudio.html#a9">tickStream</a> (int streamID)</td></tr>
  39. <tr><td>&nbsp;</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>
  40. <tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classRtAudio.html#a10">closeStream</a> (int streamID)</td></tr>
  41. <tr><td>&nbsp;</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>
  42. <tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classRtAudio.html#a11">startStream</a> (int streamID)</td></tr>
  43. <tr><td>&nbsp;</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>
  44. <tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classRtAudio.html#a12">stopStream</a> (int streamID)</td></tr>
  45. <tr><td>&nbsp;</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>
  46. <tr><td nowrap align=right valign=top>void&nbsp;</td><td valign=bottom><a class="el" href="classRtAudio.html#a13">abortStream</a> (int streamID)</td></tr>
  47. <tr><td>&nbsp;</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>
  48. <tr><td nowrap align=right valign=top>int&nbsp;</td><td valign=bottom><a class="el" href="classRtAudio.html#a14">streamWillBlock</a> (int streamID)</td></tr>
  49. <tr><td>&nbsp;</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>
  50. <tr><td colspan=2><br><h2>Static Public Attributes</h2></td></tr>
  51. <tr><td nowrap align=right valign=top>const <a class="el" href="classRtAudio.html#s0">RTAUDIO_FORMAT</a>&nbsp;</td><td valign=bottom><a class="el" href="classRtAudio.html#p0">RTAUDIO_SINT8</a></td></tr>
  52. <tr><td nowrap align=right valign=top>const <a class="el" href="classRtAudio.html#s0">RTAUDIO_FORMAT</a>&nbsp;</td><td valign=bottom><a class="el" href="classRtAudio.html#p1">RTAUDIO_SINT16</a></td></tr>
  53. <tr><td nowrap align=right valign=top>const <a class="el" href="classRtAudio.html#s0">RTAUDIO_FORMAT</a>&nbsp;</td><td valign=bottom><a class="el" href="classRtAudio.html#p2">RTAUDIO_SINT24</a></td></tr>
  54. <tr><td nowrap align=right valign=top>const <a class="el" href="classRtAudio.html#s0">RTAUDIO_FORMAT</a>&nbsp;</td><td valign=bottom><a class="el" href="classRtAudio.html#p3">RTAUDIO_SINT32</a></td></tr>
  55. <tr><td nowrap align=right valign=top>const <a class="el" href="classRtAudio.html#s0">RTAUDIO_FORMAT</a>&nbsp;</td><td valign=bottom><a class="el" href="classRtAudio.html#p4">RTAUDIO_FLOAT32</a></td></tr>
  56. <tr><td nowrap align=right valign=top>const <a class="el" href="classRtAudio.html#s0">RTAUDIO_FORMAT</a>&nbsp;</td><td valign=bottom><a class="el" href="classRtAudio.html#p5">RTAUDIO_FLOAT64</a></td></tr>
  57. </table>
  58. <hr><h2>Member Typedef Documentation</h2>
  59. <a name="s0" doxytag="RtAudio::RTAUDIO_FORMAT"></a><p>
  60. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  61. <tr>
  62. <td class="md">
  63. <table cellpadding="0" cellspacing="0" border="0">
  64. <tr>
  65. <td nowrap valign="top"><b>
  66. typedef unsigned long RtAudio::RTAUDIO_FORMAT
  67. </b></td>
  68. </tr>
  69. </table>
  70. </td>
  71. </tr>
  72. </table>
  73. <table cellspacing=5 cellpadding=0 border=0>
  74. <tr>
  75. <td>
  76. &nbsp;
  77. </td>
  78. <td>
  79. <p>
  80. </td>
  81. </tr>
  82. </table>
  83. <a name="s1" doxytag="RtAudio::RTAUDIO_CALLBACK"></a><p>
  84. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  85. <tr>
  86. <td class="md">
  87. <table cellpadding="0" cellspacing="0" border="0">
  88. <tr>
  89. <td nowrap valign="top"><b>
  90. typedef int(* RtAudio::RTAUDIO_CALLBACK)(char *buffer, int bufferSize, void *userData)
  91. </b></td>
  92. </tr>
  93. </table>
  94. </td>
  95. </tr>
  96. </table>
  97. <table cellspacing=5 cellpadding=0 border=0>
  98. <tr>
  99. <td>
  100. &nbsp;
  101. </td>
  102. <td>
  103. <p>
  104. </td>
  105. </tr>
  106. </table>
  107. <hr><h2>Member Enumeration Documentation</h2>
  108. <a name="s3" doxytag="RtAudio::@0"></a><p>
  109. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  110. <tr>
  111. <td class="md">
  112. <table cellpadding="0" cellspacing="0" border="0">
  113. <tr>
  114. <td nowrap valign="top"><b>
  115. anonymous enum
  116. </b></td>
  117. </tr>
  118. </table>
  119. </td>
  120. </tr>
  121. </table>
  122. <table cellspacing=5 cellpadding=0 border=0>
  123. <tr>
  124. <td>
  125. &nbsp;
  126. </td>
  127. <td>
  128. <p>
  129. <dl compact><dt>
  130. <b>Enumeration values:</b><dd>
  131. <table border=0 cellspacing=2 cellpadding=0>
  132. <tr><td valign=top><a name="s3s2" doxytag="MAX_SAMPLE_RATES"></a><em>MAX_SAMPLE_RATES</em>
  133. &nbsp;</td><td>
  134. </td></tr>
  135. </table>
  136. </dl>
  137. </td>
  138. </tr>
  139. </table>
  140. <hr><h2>Constructor &amp; Destructor Documentation</h2>
  141. <a name="a0" doxytag="RtAudio::RtAudio"></a><p>
  142. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  143. <tr>
  144. <td class="md">
  145. <table cellpadding="0" cellspacing="0" border="0">
  146. <tr>
  147. <td nowrap valign="top"><b>
  148. RtAudio::RtAudio (
  149. </b></td>
  150. <td valign="bottom"><b>
  151. )
  152. </b></td>
  153. </tr>
  154. </table>
  155. </td>
  156. </tr>
  157. </table>
  158. <table cellspacing=5 cellpadding=0 border=0>
  159. <tr>
  160. <td>
  161. &nbsp;
  162. </td>
  163. <td>
  164. <p>
  165. The default constructor.
  166. <p>
  167. 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="classRtAudioError.html">RtAudioError</a> error can be thrown if no devices are found or if a memory allocation error occurs. </td>
  168. </tr>
  169. </table>
  170. <a name="a1" doxytag="RtAudio::RtAudio"></a><p>
  171. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  172. <tr>
  173. <td class="md">
  174. <table cellpadding="0" cellspacing="0" border="0">
  175. <tr>
  176. <td nowrap valign="top"><b>
  177. RtAudio::RtAudio (
  178. </b></td>
  179. <td valign="bottom"><b>
  180. int * <em>streamID</em>,
  181. </b></td>
  182. </tr>
  183. <tr>
  184. <td></td>
  185. <td><b>
  186. int <em>outputDevice</em>,
  187. </b></td>
  188. </tr>
  189. <tr>
  190. <td></td>
  191. <td><b>
  192. int <em>outputChannels</em>,
  193. </b></td>
  194. </tr>
  195. <tr>
  196. <td></td>
  197. <td><b>
  198. int <em>inputDevice</em>,
  199. </b></td>
  200. </tr>
  201. <tr>
  202. <td></td>
  203. <td><b>
  204. int <em>inputChannels</em>,
  205. </b></td>
  206. </tr>
  207. <tr>
  208. <td></td>
  209. <td><b>
  210. <a class="el" href="classRtAudio.html#s0">RTAUDIO_FORMAT</a> <em>format</em>,
  211. </b></td>
  212. </tr>
  213. <tr>
  214. <td></td>
  215. <td><b>
  216. int <em>sampleRate</em>,
  217. </b></td>
  218. </tr>
  219. <tr>
  220. <td></td>
  221. <td><b>
  222. int * <em>bufferSize</em>,
  223. </b></td>
  224. </tr>
  225. <tr>
  226. <td></td>
  227. <td><b>
  228. int <em>numberOfBuffers</em>&nbsp;)
  229. </b></td>
  230. </tr>
  231. </table>
  232. </td>
  233. </tr>
  234. </table>
  235. <table cellspacing=5 cellpadding=0 border=0>
  236. <tr>
  237. <td>
  238. &nbsp;
  239. </td>
  240. <td>
  241. <p>
  242. A constructor which can be used to open a stream during instantiation.
  243. <p>
  244. 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="classRtAudioError.html">RtAudioError</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>
  245. <b>See also: </b><dd>
  246. <a class="el" href="classRtAudio.html#a3">openStream</a>() </dl> </td>
  247. </tr>
  248. </table>
  249. <a name="a2" doxytag="RtAudio::~RtAudio"></a><p>
  250. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  251. <tr>
  252. <td class="md">
  253. <table cellpadding="0" cellspacing="0" border="0">
  254. <tr>
  255. <td nowrap valign="top"><b>
  256. RtAudio::~RtAudio (
  257. </b></td>
  258. <td valign="bottom"><b>
  259. )
  260. </b></td>
  261. </tr>
  262. </table>
  263. </td>
  264. </tr>
  265. </table>
  266. <table cellspacing=5 cellpadding=0 border=0>
  267. <tr>
  268. <td>
  269. &nbsp;
  270. </td>
  271. <td>
  272. <p>
  273. The destructor.
  274. <p>
  275. Stops and closes any open streams and devices and deallocates buffer and structure memory. </td>
  276. </tr>
  277. </table>
  278. <hr><h2>Member Function Documentation</h2>
  279. <a name="a3" doxytag="RtAudio::openStream"></a><p>
  280. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  281. <tr>
  282. <td class="md">
  283. <table cellpadding="0" cellspacing="0" border="0">
  284. <tr>
  285. <td nowrap valign="top"><b>
  286. int RtAudio::openStream (
  287. </b></td>
  288. <td valign="bottom"><b>
  289. int <em>outputDevice</em>,
  290. </b></td>
  291. </tr>
  292. <tr>
  293. <td></td>
  294. <td><b>
  295. int <em>outputChannels</em>,
  296. </b></td>
  297. </tr>
  298. <tr>
  299. <td></td>
  300. <td><b>
  301. int <em>inputDevice</em>,
  302. </b></td>
  303. </tr>
  304. <tr>
  305. <td></td>
  306. <td><b>
  307. int <em>inputChannels</em>,
  308. </b></td>
  309. </tr>
  310. <tr>
  311. <td></td>
  312. <td><b>
  313. <a class="el" href="classRtAudio.html#s0">RTAUDIO_FORMAT</a> <em>format</em>,
  314. </b></td>
  315. </tr>
  316. <tr>
  317. <td></td>
  318. <td><b>
  319. int <em>sampleRate</em>,
  320. </b></td>
  321. </tr>
  322. <tr>
  323. <td></td>
  324. <td><b>
  325. int * <em>bufferSize</em>,
  326. </b></td>
  327. </tr>
  328. <tr>
  329. <td></td>
  330. <td><b>
  331. int <em>numberOfBuffers</em>&nbsp;)
  332. </b></td>
  333. </tr>
  334. </table>
  335. </td>
  336. </tr>
  337. </table>
  338. <table cellspacing=5 cellpadding=0 border=0>
  339. <tr>
  340. <td>
  341. &nbsp;
  342. </td>
  343. <td>
  344. <p>
  345. A public method for opening a stream with the specified parameters.
  346. <p>
  347. If successful, the opened stream ID is returned. Otherwise, an <a class="el" href="classRtAudioError.html">RtAudioError</a> is thrown.<dl compact><dt>
  348. <b>Parameters: </b><dd>
  349. <table border=0 cellspacing=2 cellpadding=0>
  350. <tr><td valign=top><em>outputDevice:</em>
  351. &nbsp;</td><td>
  352. 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>
  353. <tr><td valign=top><em>outputChannels:</em>
  354. &nbsp;</td><td>
  355. The desired number of output channels. If equal to zero, the outputDevice identifier is ignored. </td></tr>
  356. <tr><td valign=top><em>inputDevice:</em>
  357. &nbsp;</td><td>
  358. 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>
  359. <tr><td valign=top><em>inputChannels:</em>
  360. &nbsp;</td><td>
  361. The desired number of input channels. If equal to zero, the inputDevice identifier is ignored. </td></tr>
  362. <tr><td valign=top><em>format:</em>
  363. &nbsp;</td><td>
  364. An RTAUDIO_FORMAT specifying the desired sample data format. </td></tr>
  365. <tr><td valign=top><em>sampleRate:</em>
  366. &nbsp;</td><td>
  367. The desired sample rate (sample frames per second). </td></tr>
  368. <tr><td valign=top><em>bufferSize:</em>
  369. &nbsp;</td><td>
  370. 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>
  371. <tr><td valign=top><em>numberOfBuffers:</em>
  372. &nbsp;</td><td>
  373. 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>
  374. </table>
  375. </dl> </td>
  376. </tr>
  377. </table>
  378. <a name="a4" doxytag="RtAudio::setStreamCallback"></a><p>
  379. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  380. <tr>
  381. <td class="md">
  382. <table cellpadding="0" cellspacing="0" border="0">
  383. <tr>
  384. <td nowrap valign="top"><b>
  385. void RtAudio::setStreamCallback (
  386. </b></td>
  387. <td valign="bottom"><b>
  388. int <em>streamID</em>,
  389. </b></td>
  390. </tr>
  391. <tr>
  392. <td></td>
  393. <td><b>
  394. <a class="el" href="classRtAudio.html#s1">RTAUDIO_CALLBACK</a> <em>callback</em>,
  395. </b></td>
  396. </tr>
  397. <tr>
  398. <td></td>
  399. <td><b>
  400. void * <em>userData</em>&nbsp;)
  401. </b></td>
  402. </tr>
  403. </table>
  404. </td>
  405. </tr>
  406. </table>
  407. <table cellspacing=5 cellpadding=0 border=0>
  408. <tr>
  409. <td>
  410. &nbsp;
  411. </td>
  412. <td>
  413. <p>
  414. A public method which sets a user-defined callback function for a given stream.
  415. <p>
  416. 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="classRtAudioError.html">RtAudioError</a> will be thrown for an invalid device argument. </td>
  417. </tr>
  418. </table>
  419. <a name="a5" doxytag="RtAudio::cancelStreamCallback"></a><p>
  420. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  421. <tr>
  422. <td class="md">
  423. <table cellpadding="0" cellspacing="0" border="0">
  424. <tr>
  425. <td nowrap valign="top"><b>
  426. void RtAudio::cancelStreamCallback (
  427. </b></td>
  428. <td valign="bottom"><b>
  429. int <em>streamID</em>&nbsp;)
  430. </b></td>
  431. </tr>
  432. </table>
  433. </td>
  434. </tr>
  435. </table>
  436. <table cellspacing=5 cellpadding=0 border=0>
  437. <tr>
  438. <td>
  439. &nbsp;
  440. </td>
  441. <td>
  442. <p>
  443. A public method which cancels a callback process and function for a given stream.
  444. <p>
  445. 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="classRtAudioError.html">RtAudioError</a> will be thrown for an invalid device argument. </td>
  446. </tr>
  447. </table>
  448. <a name="a6" doxytag="RtAudio::getDeviceCount"></a><p>
  449. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  450. <tr>
  451. <td class="md">
  452. <table cellpadding="0" cellspacing="0" border="0">
  453. <tr>
  454. <td nowrap valign="top"><b>
  455. int RtAudio::getDeviceCount (
  456. </b></td>
  457. <td valign="bottom"><b>
  458. void&nbsp;)
  459. </b></td>
  460. </tr>
  461. </table>
  462. </td>
  463. </tr>
  464. </table>
  465. <table cellspacing=5 cellpadding=0 border=0>
  466. <tr>
  467. <td>
  468. &nbsp;
  469. </td>
  470. <td>
  471. <p>
  472. A public method which returns the number of audio devices found.
  473. <p>
  474. </td>
  475. </tr>
  476. </table>
  477. <a name="a7" doxytag="RtAudio::getDeviceInfo"></a><p>
  478. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  479. <tr>
  480. <td class="md">
  481. <table cellpadding="0" cellspacing="0" border="0">
  482. <tr>
  483. <td nowrap valign="top"><b>
  484. void RtAudio::getDeviceInfo (
  485. </b></td>
  486. <td valign="bottom"><b>
  487. int <em>device</em>,
  488. </b></td>
  489. </tr>
  490. <tr>
  491. <td></td>
  492. <td><b>
  493. <a class="el" href="structRtAudio_1_1RTAUDIO__DEVICE.html">RTAUDIO_DEVICE</a> * <em>info</em>&nbsp;)
  494. </b></td>
  495. </tr>
  496. </table>
  497. </td>
  498. </tr>
  499. </table>
  500. <table cellspacing=5 cellpadding=0 border=0>
  501. <tr>
  502. <td>
  503. &nbsp;
  504. </td>
  505. <td>
  506. <p>
  507. Fill a user-supplied <a class="el" href="structRtAudio_1_1RTAUDIO__DEVICE.html">RTAUDIO_DEVICE</a> structure for a specified device.
  508. <p>
  509. Any device between 0 and <a class="el" href="classRtAudio.html#a6">getDeviceCount</a>()-1 is valid. If a device is busy or otherwise unavailable, the structure member "probed" has a value of "false". The system default input and output devices are referenced by device identifier = 0. On systems which allow dynamic default device settings, the default devices are not identified by name (specific device enumerations are assigned device identifiers &gt; 0). An <a class="el" href="classRtAudioError.html">RtAudioError</a> will be thrown for an invalid device argument. </td>
  510. </tr>
  511. </table>
  512. <a name="a8" doxytag="RtAudio::getStreamBuffer"></a><p>
  513. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  514. <tr>
  515. <td class="md">
  516. <table cellpadding="0" cellspacing="0" border="0">
  517. <tr>
  518. <td nowrap valign="top"><b>
  519. char *const RtAudio::getStreamBuffer (
  520. </b></td>
  521. <td valign="bottom"><b>
  522. int <em>streamID</em>&nbsp;)
  523. </b></td>
  524. </tr>
  525. </table>
  526. </td>
  527. </tr>
  528. </table>
  529. <table cellspacing=5 cellpadding=0 border=0>
  530. <tr>
  531. <td>
  532. &nbsp;
  533. </td>
  534. <td>
  535. <p>
  536. A public method which returns a pointer to the buffer for an open stream.
  537. <p>
  538. 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="classRtAudioError.html">RtAudioError</a> will be thrown for an invalid stream identifier. </td>
  539. </tr>
  540. </table>
  541. <a name="a9" doxytag="RtAudio::tickStream"></a><p>
  542. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  543. <tr>
  544. <td class="md">
  545. <table cellpadding="0" cellspacing="0" border="0">
  546. <tr>
  547. <td nowrap valign="top"><b>
  548. void RtAudio::tickStream (
  549. </b></td>
  550. <td valign="bottom"><b>
  551. int <em>streamID</em>&nbsp;)
  552. </b></td>
  553. </tr>
  554. </table>
  555. </td>
  556. </tr>
  557. </table>
  558. <table cellspacing=5 cellpadding=0 border=0>
  559. <tr>
  560. <td>
  561. &nbsp;
  562. </td>
  563. <td>
  564. <p>
  565. Public method used to trigger processing of input/output data for a stream.
  566. <p>
  567. This method blocks until all buffer data is read/written. An <a class="el" href="classRtAudioError.html">RtAudioError</a> will be thrown for an invalid stream identifier or if a driver error occurs. </td>
  568. </tr>
  569. </table>
  570. <a name="a10" doxytag="RtAudio::closeStream"></a><p>
  571. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  572. <tr>
  573. <td class="md">
  574. <table cellpadding="0" cellspacing="0" border="0">
  575. <tr>
  576. <td nowrap valign="top"><b>
  577. void RtAudio::closeStream (
  578. </b></td>
  579. <td valign="bottom"><b>
  580. int <em>streamID</em>&nbsp;)
  581. </b></td>
  582. </tr>
  583. </table>
  584. </td>
  585. </tr>
  586. </table>
  587. <table cellspacing=5 cellpadding=0 border=0>
  588. <tr>
  589. <td>
  590. &nbsp;
  591. </td>
  592. <td>
  593. <p>
  594. Public method which closes a stream and frees any associated buffers.
  595. <p>
  596. If an invalid stream identifier is specified, this method issues a warning and returns (an <a class="el" href="classRtAudioError.html">RtAudioError</a> is not thrown). </td>
  597. </tr>
  598. </table>
  599. <a name="a11" doxytag="RtAudio::startStream"></a><p>
  600. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  601. <tr>
  602. <td class="md">
  603. <table cellpadding="0" cellspacing="0" border="0">
  604. <tr>
  605. <td nowrap valign="top"><b>
  606. void RtAudio::startStream (
  607. </b></td>
  608. <td valign="bottom"><b>
  609. int <em>streamID</em>&nbsp;)
  610. </b></td>
  611. </tr>
  612. </table>
  613. </td>
  614. </tr>
  615. </table>
  616. <table cellspacing=5 cellpadding=0 border=0>
  617. <tr>
  618. <td>
  619. &nbsp;
  620. </td>
  621. <td>
  622. <p>
  623. Public method which starts a stream.
  624. <p>
  625. An <a class="el" href="classRtAudioError.html">RtAudioError</a> will be thrown for an invalid stream identifier or if a driver error occurs. </td>
  626. </tr>
  627. </table>
  628. <a name="a12" doxytag="RtAudio::stopStream"></a><p>
  629. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  630. <tr>
  631. <td class="md">
  632. <table cellpadding="0" cellspacing="0" border="0">
  633. <tr>
  634. <td nowrap valign="top"><b>
  635. void RtAudio::stopStream (
  636. </b></td>
  637. <td valign="bottom"><b>
  638. int <em>streamID</em>&nbsp;)
  639. </b></td>
  640. </tr>
  641. </table>
  642. </td>
  643. </tr>
  644. </table>
  645. <table cellspacing=5 cellpadding=0 border=0>
  646. <tr>
  647. <td>
  648. &nbsp;
  649. </td>
  650. <td>
  651. <p>
  652. Stop a stream, allowing any samples remaining in the queue to be played out and/or read in.
  653. <p>
  654. An <a class="el" href="classRtAudioError.html">RtAudioError</a> will be thrown for an invalid stream identifier or if a driver error occurs. </td>
  655. </tr>
  656. </table>
  657. <a name="a13" doxytag="RtAudio::abortStream"></a><p>
  658. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  659. <tr>
  660. <td class="md">
  661. <table cellpadding="0" cellspacing="0" border="0">
  662. <tr>
  663. <td nowrap valign="top"><b>
  664. void RtAudio::abortStream (
  665. </b></td>
  666. <td valign="bottom"><b>
  667. int <em>streamID</em>&nbsp;)
  668. </b></td>
  669. </tr>
  670. </table>
  671. </td>
  672. </tr>
  673. </table>
  674. <table cellspacing=5 cellpadding=0 border=0>
  675. <tr>
  676. <td>
  677. &nbsp;
  678. </td>
  679. <td>
  680. <p>
  681. Stop a stream, discarding any samples remaining in the input/output queue.
  682. <p>
  683. An <a class="el" href="classRtAudioError.html">RtAudioError</a> will be thrown for an invalid stream identifier or if a driver error occurs. </td>
  684. </tr>
  685. </table>
  686. <a name="a14" doxytag="RtAudio::streamWillBlock"></a><p>
  687. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  688. <tr>
  689. <td class="md">
  690. <table cellpadding="0" cellspacing="0" border="0">
  691. <tr>
  692. <td nowrap valign="top"><b>
  693. int RtAudio::streamWillBlock (
  694. </b></td>
  695. <td valign="bottom"><b>
  696. int <em>streamID</em>&nbsp;)
  697. </b></td>
  698. </tr>
  699. </table>
  700. </td>
  701. </tr>
  702. </table>
  703. <table cellspacing=5 cellpadding=0 border=0>
  704. <tr>
  705. <td>
  706. &nbsp;
  707. </td>
  708. <td>
  709. <p>
  710. Queries a stream to determine whether a call to the <a class="el" href="classRtAudio.html#a9">tickStream</a>() method will block.
  711. <p>
  712. 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>
  713. </tr>
  714. </table>
  715. <hr><h2>Member Data Documentation</h2>
  716. <a name="p0" doxytag="RtAudio::RTAUDIO_SINT8"></a><p>
  717. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  718. <tr>
  719. <td class="md">
  720. <table cellpadding="0" cellspacing="0" border="0">
  721. <tr>
  722. <td nowrap valign="top"><b>
  723. const <a class="el" href="classRtAudio.html#s0">RTAUDIO_FORMAT</a> RtAudio::RTAUDIO_SINT8<code> [static]</code>
  724. </b></td>
  725. </tr>
  726. </table>
  727. </td>
  728. </tr>
  729. </table>
  730. <table cellspacing=5 cellpadding=0 border=0>
  731. <tr>
  732. <td>
  733. &nbsp;
  734. </td>
  735. <td>
  736. <p>
  737. </td>
  738. </tr>
  739. </table>
  740. <a name="p1" doxytag="RtAudio::RTAUDIO_SINT16"></a><p>
  741. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  742. <tr>
  743. <td class="md">
  744. <table cellpadding="0" cellspacing="0" border="0">
  745. <tr>
  746. <td nowrap valign="top"><b>
  747. const <a class="el" href="classRtAudio.html#s0">RTAUDIO_FORMAT</a> RtAudio::RTAUDIO_SINT16<code> [static]</code>
  748. </b></td>
  749. </tr>
  750. </table>
  751. </td>
  752. </tr>
  753. </table>
  754. <table cellspacing=5 cellpadding=0 border=0>
  755. <tr>
  756. <td>
  757. &nbsp;
  758. </td>
  759. <td>
  760. <p>
  761. </td>
  762. </tr>
  763. </table>
  764. <a name="p2" doxytag="RtAudio::RTAUDIO_SINT24"></a><p>
  765. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  766. <tr>
  767. <td class="md">
  768. <table cellpadding="0" cellspacing="0" border="0">
  769. <tr>
  770. <td nowrap valign="top"><b>
  771. const <a class="el" href="classRtAudio.html#s0">RTAUDIO_FORMAT</a> RtAudio::RTAUDIO_SINT24<code> [static]</code>
  772. </b></td>
  773. </tr>
  774. </table>
  775. </td>
  776. </tr>
  777. </table>
  778. <table cellspacing=5 cellpadding=0 border=0>
  779. <tr>
  780. <td>
  781. &nbsp;
  782. </td>
  783. <td>
  784. <p>
  785. Upper 3 bytes of 32-bit integer. </td>
  786. </tr>
  787. </table>
  788. <a name="p3" doxytag="RtAudio::RTAUDIO_SINT32"></a><p>
  789. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  790. <tr>
  791. <td class="md">
  792. <table cellpadding="0" cellspacing="0" border="0">
  793. <tr>
  794. <td nowrap valign="top"><b>
  795. const <a class="el" href="classRtAudio.html#s0">RTAUDIO_FORMAT</a> RtAudio::RTAUDIO_SINT32<code> [static]</code>
  796. </b></td>
  797. </tr>
  798. </table>
  799. </td>
  800. </tr>
  801. </table>
  802. <table cellspacing=5 cellpadding=0 border=0>
  803. <tr>
  804. <td>
  805. &nbsp;
  806. </td>
  807. <td>
  808. <p>
  809. </td>
  810. </tr>
  811. </table>
  812. <a name="p4" doxytag="RtAudio::RTAUDIO_FLOAT32"></a><p>
  813. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  814. <tr>
  815. <td class="md">
  816. <table cellpadding="0" cellspacing="0" border="0">
  817. <tr>
  818. <td nowrap valign="top"><b>
  819. const <a class="el" href="classRtAudio.html#s0">RTAUDIO_FORMAT</a> RtAudio::RTAUDIO_FLOAT32<code> [static]</code>
  820. </b></td>
  821. </tr>
  822. </table>
  823. </td>
  824. </tr>
  825. </table>
  826. <table cellspacing=5 cellpadding=0 border=0>
  827. <tr>
  828. <td>
  829. &nbsp;
  830. </td>
  831. <td>
  832. <p>
  833. Normalized between plus/minus 1.0. </td>
  834. </tr>
  835. </table>
  836. <a name="p5" doxytag="RtAudio::RTAUDIO_FLOAT64"></a><p>
  837. <table width="100%" cellpadding="2" cellspacing="0" border="0">
  838. <tr>
  839. <td class="md">
  840. <table cellpadding="0" cellspacing="0" border="0">
  841. <tr>
  842. <td nowrap valign="top"><b>
  843. const <a class="el" href="classRtAudio.html#s0">RTAUDIO_FORMAT</a> RtAudio::RTAUDIO_FLOAT64<code> [static]</code>
  844. </b></td>
  845. </tr>
  846. </table>
  847. </td>
  848. </tr>
  849. </table>
  850. <table cellspacing=5 cellpadding=0 border=0>
  851. <tr>
  852. <td>
  853. &nbsp;
  854. </td>
  855. <td>
  856. <p>
  857. Normalized between plus/minus 1.0. </td>
  858. </tr>
  859. </table>
  860. <hr>The documentation for this class was generated from the following file:<ul>
  861. <li><a class="el" href="RtAudio_8h-source.html">RtAudio.h</a></ul>
  862. <HR>
  863. <table><tr><td><img src="../ccrma.gif">
  864. <td>&copy;2001-2002 CCRMA, Stanford University. All Rights Reserved.<br>
  865. Maintained by Gary P. Scavone, <a href="mailto:gary@ccrma.stanford.edu">gary@ccrma.stanford.edu</a><P>
  866. </table>
  867. </BODY>
  868. </HTML>