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.

337 lines
22KB

  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.h</h1><div class="fragment"><pre>00001 <font class="comment">/************************************************************************/</font>
  12. 00038 <font class="comment">/************************************************************************/</font>
  13. 00039
  14. 00040 <font class="preprocessor">#if !defined(__RTAUDIO_H)</font>
  15. 00041 <font class="preprocessor"></font><font class="preprocessor">#define __RTAUDIO_H</font>
  16. 00042 <font class="preprocessor"></font>
  17. 00043 <font class="preprocessor">#include &lt;map&gt;</font>
  18. 00044
  19. 00045 <font class="preprocessor">#if defined(__LINUX_ALSA__)</font>
  20. 00046 <font class="preprocessor"></font><font class="preprocessor"> #include &lt;alsa/asoundlib.h&gt;</font>
  21. 00047 <font class="preprocessor"> #include &lt;pthread.h&gt;</font>
  22. 00048 <font class="preprocessor"> #include &lt;unistd.h&gt;</font>
  23. 00049
  24. 00050 <font class="keyword">typedef</font> snd_pcm_t *AUDIO_HANDLE;
  25. 00051 <font class="keyword">typedef</font> <font class="keywordtype">int</font> DEVICE_ID;
  26. 00052 <font class="keyword">typedef</font> pthread_t THREAD_HANDLE;
  27. 00053 <font class="keyword">typedef</font> pthread_mutex_t MUTEX;
  28. 00054
  29. 00055 <font class="preprocessor">#elif defined(__LINUX_OSS__)</font>
  30. 00056 <font class="preprocessor"></font><font class="preprocessor"> #include &lt;pthread.h&gt;</font>
  31. 00057 <font class="preprocessor"> #include &lt;unistd.h&gt;</font>
  32. 00058
  33. 00059 <font class="keyword">typedef</font> <font class="keywordtype">int</font> AUDIO_HANDLE;
  34. 00060 <font class="keyword">typedef</font> <font class="keywordtype">int</font> DEVICE_ID;
  35. 00061 <font class="keyword">typedef</font> pthread_t THREAD_HANDLE;
  36. 00062 <font class="keyword">typedef</font> pthread_mutex_t MUTEX;
  37. 00063
  38. 00064 <font class="preprocessor">#elif defined(__WINDOWS_DS__)</font>
  39. 00065 <font class="preprocessor"></font><font class="preprocessor"> #include &lt;windows.h&gt;</font>
  40. 00066 <font class="preprocessor"> #include &lt;process.h&gt;</font>
  41. 00067
  42. 00068 <font class="comment">// The following struct is used to hold the extra variables</font>
  43. 00069 <font class="comment">// specific to the DirectSound implementation.</font>
  44. 00070 <font class="keyword">typedef</font> <font class="keyword">struct </font>{
  45. 00071 <font class="keywordtype">void</font> * object;
  46. 00072 <font class="keywordtype">void</font> * buffer;
  47. 00073 UINT bufferPointer;
  48. 00074 } AUDIO_HANDLE;
  49. 00075
  50. 00076 <font class="keyword">typedef</font> LPGUID DEVICE_ID;
  51. 00077 <font class="keyword">typedef</font> <font class="keywordtype">unsigned</font> <font class="keywordtype">long</font> THREAD_HANDLE;
  52. 00078 <font class="keyword">typedef</font> CRITICAL_SECTION MUTEX;
  53. 00079
  54. 00080 <font class="preprocessor">#elif defined(__WINDOWS_ASIO__)</font>
  55. 00081 <font class="preprocessor"></font><font class="preprocessor"> #include &lt;windows.h&gt;</font>
  56. 00082 <font class="preprocessor"> #include &lt;process.h&gt;</font>
  57. 00083
  58. 00084 <font class="keyword">typedef</font> <font class="keywordtype">int</font> AUDIO_HANDLE;
  59. 00085 <font class="keyword">typedef</font> <font class="keywordtype">int</font> DEVICE_ID;
  60. 00086 <font class="keyword">typedef</font> <font class="keywordtype">unsigned</font> <font class="keywordtype">long</font> THREAD_HANDLE;
  61. 00087 <font class="keyword">typedef</font> CRITICAL_SECTION MUTEX;
  62. 00088
  63. 00089 <font class="preprocessor">#elif defined(__IRIX_AL__)</font>
  64. 00090 <font class="preprocessor"></font><font class="preprocessor"> #include &lt;dmedia/audio.h&gt;</font>
  65. 00091 <font class="preprocessor"> #include &lt;pthread.h&gt;</font>
  66. 00092 <font class="preprocessor"> #include &lt;unistd.h&gt;</font>
  67. 00093
  68. 00094 <font class="keyword">typedef</font> ALport AUDIO_HANDLE;
  69. 00095 <font class="keyword">typedef</font> <font class="keywordtype">long</font> DEVICE_ID;
  70. 00096 <font class="keyword">typedef</font> pthread_t THREAD_HANDLE;
  71. 00097 <font class="keyword">typedef</font> pthread_mutex_t MUTEX;
  72. 00098
  73. 00099 <font class="preprocessor">#elif defined(__MACOSX_CORE__)</font>
  74. 00100 <font class="preprocessor"></font>
  75. 00101 <font class="preprocessor"> #include &lt;CoreServices/CoreServices.h&gt;</font>
  76. 00102 <font class="preprocessor"> #include &lt;CoreAudio/AudioHardware.h&gt;</font>
  77. 00103 <font class="preprocessor"> #include &lt;pthread.h&gt;</font>
  78. 00104
  79. 00105 <font class="keyword">typedef</font> <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> AUDIO_HANDLE;
  80. 00106 <font class="keyword">typedef</font> AudioDeviceID DEVICE_ID;
  81. 00107 <font class="keyword">typedef</font> pthread_t THREAD_HANDLE;
  82. 00108 <font class="keyword">typedef</font> pthread_mutex_t MUTEX;
  83. 00109
  84. 00110 <font class="preprocessor">#endif</font>
  85. 00111 <font class="preprocessor"></font>
  86. 00112
  87. 00113 <font class="comment">/************************************************************************/</font>
  88. 00126 <font class="comment">/************************************************************************/</font>
  89. 00127
  90. 00128 <font class="keyword">class </font><a class="code" href="classRtError.html">RtError</a>
  91. 00129 {
  92. 00130 <font class="keyword">public</font>:
  93. <a name="l00132"></a><a class="code" href="classRtError.html#s11">00132</a> <font class="keyword">enum</font> TYPE {
  94. 00133 WARNING,
  95. 00134 DEBUG_WARNING,
  96. 00135 UNSPECIFIED,
  97. 00136 NO_DEVICES_FOUND,
  98. 00137 INVALID_DEVICE,
  99. 00138 INVALID_STREAM,
  100. 00139 MEMORY_ERROR,
  101. 00140 INVALID_PARAMETER,
  102. 00141 DRIVER_ERROR,
  103. 00142 SYSTEM_ERROR,
  104. 00143 THREAD_ERROR
  105. 00144 };
  106. 00145
  107. 00146 <font class="keyword">protected</font>:
  108. 00147 <font class="keywordtype">char</font> error_message[256];
  109. 00148 TYPE type;
  110. 00149
  111. 00150 <font class="keyword">public</font>:
  112. 00152 <a class="code" href="classRtError.html#a0">RtError</a>(<font class="keyword">const</font> <font class="keywordtype">char</font> *p, TYPE tipe = RtError::UNSPECIFIED);
  113. 00153
  114. 00155 <font class="keyword">virtual</font> <a class="code" href="classRtError.html#a1">~RtError</a>(<font class="keywordtype">void</font>);
  115. 00156
  116. 00158 <font class="keyword">virtual</font> <font class="keywordtype">void</font> <a class="code" href="classRtError.html#a2">printMessage</a>(<font class="keywordtype">void</font>);
  117. 00159
  118. <a name="l00161"></a><a class="code" href="classRtError.html#a3">00161</a> <font class="keyword">virtual</font> <font class="keyword">const</font> TYPE&amp; <a class="code" href="classRtError.html#a3">getType</a>(<font class="keywordtype">void</font>)<font class="keyword"> </font>{ <font class="keywordflow">return</font> type; }
  119. 00162
  120. <a name="l00164"></a><a class="code" href="classRtError.html#a4">00164</a> <font class="keyword">virtual</font> <font class="keyword">const</font> <font class="keywordtype">char</font> *<a class="code" href="classRtError.html#a4">getMessage</a>(<font class="keywordtype">void</font>)<font class="keyword"> </font>{ <font class="keywordflow">return</font> error_message; }
  121. 00165 };
  122. 00166
  123. 00167
  124. 00168 <font class="comment">// This public structure type is used to pass callback information</font>
  125. 00169 <font class="comment">// between the private RtAudio stream structure and global callback</font>
  126. 00170 <font class="comment">// handling functions.</font>
  127. 00171 <font class="keyword">typedef</font> <font class="keyword">struct </font>{
  128. 00172 <font class="keywordtype">void</font> *object; <font class="comment">// Used as a "this" pointer.</font>
  129. 00173 <font class="keywordtype">int</font> streamId;
  130. 00174 DEVICE_ID device[2];
  131. 00175 THREAD_HANDLE thread;
  132. 00176 <font class="keywordtype">void</font> *callback;
  133. 00177 <font class="keywordtype">void</font> *buffers;
  134. 00178 <font class="keywordtype">unsigned</font> <font class="keywordtype">long</font> waitTime;
  135. 00179 <font class="keywordtype">bool</font> blockTick;
  136. 00180 <font class="keywordtype">bool</font> stopStream;
  137. 00181 <font class="keywordtype">bool</font> usingCallback;
  138. 00182 <font class="keywordtype">void</font> *userData;
  139. 00183 } CALLBACK_INFO;
  140. 00184
  141. 00185
  142. 00186 <font class="comment">// *************************************************** //</font>
  143. 00187 <font class="comment">//</font>
  144. 00188 <font class="comment">// RtAudio class declaration.</font>
  145. 00189 <font class="comment">//</font>
  146. 00190 <font class="comment">// *************************************************** //</font>
  147. 00191
  148. 00192 <font class="keyword">class </font><a class="code" href="classRtAudio.html">RtAudio</a>
  149. 00193 {
  150. 00194 <font class="keyword">public</font>:
  151. 00195
  152. 00196 <font class="comment">// Support for signed integers and floats. Audio data fed to/from</font>
  153. 00197 <font class="comment">// the tickStream() routine is assumed to ALWAYS be in host</font>
  154. 00198 <font class="comment">// byte order. The internal routines will automatically take care of</font>
  155. 00199 <font class="comment">// any necessary byte-swapping between the host format and the</font>
  156. 00200 <font class="comment">// soundcard. Thus, endian-ness is not a concern in the following</font>
  157. 00201 <font class="comment">// format definitions.</font>
  158. 00202 <font class="keyword">typedef</font> <font class="keywordtype">unsigned</font> <font class="keywordtype">long</font> RTAUDIO_FORMAT;
  159. <a name="l00203"></a><a class="code" href="classRtAudio.html#p0">00203</a> <font class="keyword">static</font> <font class="keyword">const</font> RTAUDIO_FORMAT RTAUDIO_SINT8;
  160. <a name="l00204"></a><a class="code" href="classRtAudio.html#p1">00204</a> <font class="keyword">static</font> <font class="keyword">const</font> RTAUDIO_FORMAT RTAUDIO_SINT16;
  161. <a name="l00205"></a><a class="code" href="classRtAudio.html#p2">00205</a> <font class="keyword">static</font> <font class="keyword">const</font> RTAUDIO_FORMAT RTAUDIO_SINT24;
  162. <a name="l00206"></a><a class="code" href="classRtAudio.html#p3">00206</a> <font class="keyword">static</font> <font class="keyword">const</font> RTAUDIO_FORMAT RTAUDIO_SINT32;
  163. <a name="l00207"></a><a class="code" href="classRtAudio.html#p4">00207</a> <font class="keyword">static</font> <font class="keyword">const</font> RTAUDIO_FORMAT RTAUDIO_FLOAT32;
  164. <a name="l00208"></a><a class="code" href="classRtAudio.html#p5">00208</a> <font class="keyword">static</font> <font class="keyword">const</font> RTAUDIO_FORMAT RTAUDIO_FLOAT64;
  165. 00210 <font class="comment">//static const int MAX_SAMPLE_RATES = 14;</font>
  166. 00211 <font class="keyword">enum</font> { MAX_SAMPLE_RATES = 14 };
  167. 00212
  168. 00213 <font class="keyword">typedef</font> int (*RTAUDIO_CALLBACK)(<font class="keywordtype">char</font> *buffer, <font class="keywordtype">int</font> bufferSize, <font class="keywordtype">void</font> *userData);
  169. 00214
  170. <a name="l00216"></a><a class="code" href="structRtAudio_1_1RTAUDIO__DEVICE.html">00216</a> <font class="keyword">typedef</font> <font class="keyword">struct </font>{
  171. <a name="l00217"></a><a class="code" href="structRtAudio_1_1RTAUDIO__DEVICE.html#m0">00217</a> <font class="keywordtype">char</font> name[128];
  172. 00218 DEVICE_ID id[2]; <font class="comment">/* No value reported by getDeviceInfo(). */</font>
  173. <a name="l00219"></a><a class="code" href="structRtAudio_1_1RTAUDIO__DEVICE.html#m2">00219</a> <font class="keywordtype">bool</font> probed;
  174. <a name="l00220"></a><a class="code" href="structRtAudio_1_1RTAUDIO__DEVICE.html#m3">00220</a> <font class="keywordtype">int</font> maxOutputChannels;
  175. <a name="l00221"></a><a class="code" href="structRtAudio_1_1RTAUDIO__DEVICE.html#m4">00221</a> <font class="keywordtype">int</font> maxInputChannels;
  176. <a name="l00222"></a><a class="code" href="structRtAudio_1_1RTAUDIO__DEVICE.html#m5">00222</a> <font class="keywordtype">int</font> maxDuplexChannels;
  177. <a name="l00223"></a><a class="code" href="structRtAudio_1_1RTAUDIO__DEVICE.html#m6">00223</a> <font class="keywordtype">int</font> minOutputChannels;
  178. <a name="l00224"></a><a class="code" href="structRtAudio_1_1RTAUDIO__DEVICE.html#m7">00224</a> <font class="keywordtype">int</font> minInputChannels;
  179. <a name="l00225"></a><a class="code" href="structRtAudio_1_1RTAUDIO__DEVICE.html#m8">00225</a> <font class="keywordtype">int</font> minDuplexChannels;
  180. <a name="l00226"></a><a class="code" href="structRtAudio_1_1RTAUDIO__DEVICE.html#m9">00226</a> <font class="keywordtype">bool</font> hasDuplexSupport;
  181. <a name="l00227"></a><a class="code" href="structRtAudio_1_1RTAUDIO__DEVICE.html#m10">00227</a> <font class="keywordtype">bool</font> isDefault;
  182. <a name="l00228"></a><a class="code" href="structRtAudio_1_1RTAUDIO__DEVICE.html#m11">00228</a> <font class="keywordtype">int</font> nSampleRates;
  183. <a name="l00229"></a><a class="code" href="structRtAudio_1_1RTAUDIO__DEVICE.html#m12">00229</a> <font class="keywordtype">int</font> sampleRates[MAX_SAMPLE_RATES];
  184. <a name="l00230"></a><a class="code" href="structRtAudio_1_1RTAUDIO__DEVICE.html#m13">00230</a> RTAUDIO_FORMAT nativeFormats;
  185. 00231 } RTAUDIO_DEVICE;
  186. 00232
  187. 00234
  188. 00240 <a class="code" href="classRtAudio.html#a0">RtAudio</a>();
  189. 00241
  190. 00243
  191. 00254 <a class="code" href="classRtAudio.html#a0">RtAudio</a>(<font class="keywordtype">int</font> *streamId,
  192. 00255 <font class="keywordtype">int</font> outputDevice, <font class="keywordtype">int</font> outputChannels,
  193. 00256 <font class="keywordtype">int</font> inputDevice, <font class="keywordtype">int</font> inputChannels,
  194. 00257 RTAUDIO_FORMAT format, <font class="keywordtype">int</font> sampleRate,
  195. 00258 <font class="keywordtype">int</font> *bufferSize, <font class="keywordtype">int</font> numberOfBuffers);
  196. 00259
  197. 00261
  198. 00265 <a class="code" href="classRtAudio.html#a2">~RtAudio</a>();
  199. 00266
  200. 00268
  201. 00295 <font class="keywordtype">int</font> <a class="code" href="classRtAudio.html#a3">openStream</a>(<font class="keywordtype">int</font> outputDevice, <font class="keywordtype">int</font> outputChannels,
  202. 00296 <font class="keywordtype">int</font> inputDevice, <font class="keywordtype">int</font> inputChannels,
  203. 00297 RTAUDIO_FORMAT format, <font class="keywordtype">int</font> sampleRate,
  204. 00298 <font class="keywordtype">int</font> *bufferSize, <font class="keywordtype">int</font> numberOfBuffers);
  205. 00299
  206. 00301
  207. 00320 <font class="keywordtype">void</font> <a class="code" href="classRtAudio.html#a4">setStreamCallback</a>(<font class="keywordtype">int</font> streamId, RTAUDIO_CALLBACK callback, <font class="keywordtype">void</font> *userData);
  208. 00321
  209. 00323
  210. 00330 <font class="keywordtype">void</font> <a class="code" href="classRtAudio.html#a5">cancelStreamCallback</a>(<font class="keywordtype">int</font> streamId);
  211. 00331
  212. 00333 <font class="keywordtype">int</font> <a class="code" href="classRtAudio.html#a6">getDeviceCount</a>(<font class="keywordtype">void</font>);
  213. 00334
  214. 00336
  215. 00344 <font class="keywordtype">void</font> <a class="code" href="classRtAudio.html#a7">getDeviceInfo</a>(<font class="keywordtype">int</font> device, RTAUDIO_DEVICE *info);
  216. 00345
  217. 00347
  218. 00352 <font class="keywordtype">char</font> * <font class="keyword">const</font> <a class="code" href="classRtAudio.html#a8">getStreamBuffer</a>(<font class="keywordtype">int</font> streamId);
  219. 00353
  220. 00355
  221. 00360 <font class="keywordtype">void</font> <a class="code" href="classRtAudio.html#a9">tickStream</a>(<font class="keywordtype">int</font> streamId);
  222. 00361
  223. 00363
  224. 00367 <font class="keywordtype">void</font> <a class="code" href="classRtAudio.html#a10">closeStream</a>(<font class="keywordtype">int</font> streamId);
  225. 00368
  226. 00370
  227. 00374 <font class="keywordtype">void</font> <a class="code" href="classRtAudio.html#a11">startStream</a>(<font class="keywordtype">int</font> streamId);
  228. 00375
  229. 00377
  230. 00381 <font class="keywordtype">void</font> <a class="code" href="classRtAudio.html#a12">stopStream</a>(<font class="keywordtype">int</font> streamId);
  231. 00382
  232. 00384
  233. 00388 <font class="keywordtype">void</font> <a class="code" href="classRtAudio.html#a13">abortStream</a>(<font class="keywordtype">int</font> streamId);
  234. 00389
  235. 00391
  236. 00396 <font class="keywordtype">int</font> <a class="code" href="classRtAudio.html#a14">streamWillBlock</a>(<font class="keywordtype">int</font> streamId);
  237. 00397
  238. 00398 <font class="preprocessor">#if (defined(__MACOSX_CORE__) || defined(__WINDOWS_ASIO__))</font>
  239. 00399 <font class="preprocessor"></font> <font class="comment">// This function is intended for internal use only. It must be</font>
  240. 00400 <font class="comment">// public because it is called by the internal callback handler,</font>
  241. 00401 <font class="comment">// which is not a member of RtAudio. External use of this function</font>
  242. 00402 <font class="comment">// will most likely produce highly undesireable results!</font>
  243. 00403 <font class="keywordtype">void</font> callbackEvent(<font class="keywordtype">int</font> streamId, DEVICE_ID deviceId, <font class="keywordtype">void</font> *inData, <font class="keywordtype">void</font> *outData);
  244. 00404 <font class="preprocessor">#endif</font>
  245. 00405 <font class="preprocessor"></font>
  246. 00406 <font class="keyword">protected</font>:
  247. 00407
  248. 00408 <font class="keyword">private</font>:
  249. 00409
  250. 00410 <font class="keyword">static</font> <font class="keyword">const</font> <font class="keywordtype">unsigned</font> <font class="keywordtype">int</font> SAMPLE_RATES[MAX_SAMPLE_RATES];
  251. 00411
  252. 00412 <font class="keyword">enum</font> { FAILURE, SUCCESS };
  253. 00413
  254. 00414 <font class="keyword">enum</font> STREAM_MODE {
  255. 00415 OUTPUT,
  256. 00416 INPUT,
  257. 00417 DUPLEX,
  258. 00418 UNINITIALIZED = -75
  259. 00419 };
  260. 00420
  261. 00421 <font class="keyword">enum</font> STREAM_STATE {
  262. 00422 STREAM_STOPPED,
  263. 00423 STREAM_RUNNING
  264. 00424 };
  265. 00425
  266. 00426 <font class="keyword">typedef</font> <font class="keyword">struct </font>{
  267. 00427 <font class="keywordtype">int</font> device[2]; <font class="comment">// Playback and record, respectively.</font>
  268. 00428 STREAM_MODE mode; <font class="comment">// OUTPUT, INPUT, or DUPLEX.</font>
  269. 00429 AUDIO_HANDLE handle[2]; <font class="comment">// Playback and record handles, respectively.</font>
  270. 00430 STREAM_STATE state; <font class="comment">// STOPPED or RUNNING</font>
  271. 00431 <font class="keywordtype">char</font> *userBuffer;
  272. 00432 <font class="keywordtype">char</font> *deviceBuffer;
  273. 00433 <font class="keywordtype">bool</font> doConvertBuffer[2]; <font class="comment">// Playback and record, respectively.</font>
  274. 00434 <font class="keywordtype">bool</font> deInterleave[2]; <font class="comment">// Playback and record, respectively.</font>
  275. 00435 <font class="keywordtype">bool</font> doByteSwap[2]; <font class="comment">// Playback and record, respectively.</font>
  276. 00436 <font class="keywordtype">int</font> sampleRate;
  277. 00437 <font class="keywordtype">int</font> bufferSize;
  278. 00438 <font class="keywordtype">int</font> nBuffers;
  279. 00439 <font class="keywordtype">int</font> nUserChannels[2]; <font class="comment">// Playback and record, respectively.</font>
  280. 00440 <font class="keywordtype">int</font> nDeviceChannels[2]; <font class="comment">// Playback and record channels, respectively.</font>
  281. 00441 RTAUDIO_FORMAT userFormat;
  282. 00442 RTAUDIO_FORMAT deviceFormat[2]; <font class="comment">// Playback and record, respectively.</font>
  283. 00443 MUTEX mutex;
  284. 00444 CALLBACK_INFO callbackInfo;
  285. 00445 } RTAUDIO_STREAM;
  286. 00446
  287. 00447 <font class="keyword">typedef</font> <font class="keywordtype">signed</font> <font class="keywordtype">short</font> INT16;
  288. 00448 <font class="keyword">typedef</font> <font class="keywordtype">signed</font> <font class="keywordtype">int</font> INT32;
  289. 00449 <font class="keyword">typedef</font> <font class="keywordtype">float</font> FLOAT32;
  290. 00450 <font class="keyword">typedef</font> <font class="keywordtype">double</font> FLOAT64;
  291. 00451
  292. 00452 <font class="keywordtype">char</font> message[256];
  293. 00453 <font class="keywordtype">int</font> nDevices;
  294. 00454 RTAUDIO_DEVICE *devices;
  295. 00455
  296. 00456 std::map&lt;int, void *&gt; streams;
  297. 00457
  298. 00459 <font class="keywordtype">void</font> error(RtError::TYPE type);
  299. 00460
  300. 00465 <font class="keywordtype">void</font> initialize(<font class="keywordtype">void</font>);
  301. 00466
  302. 00471 <font class="keywordtype">int</font> getDefaultInputDevice(<font class="keywordtype">void</font>);
  303. 00472
  304. 00477 <font class="keywordtype">int</font> getDefaultOutputDevice(<font class="keywordtype">void</font>);
  305. 00478
  306. 00480 <font class="keywordtype">void</font> clearDeviceInfo(RTAUDIO_DEVICE *info);
  307. 00481
  308. 00489 <font class="keywordtype">void</font> probeDeviceInfo(RTAUDIO_DEVICE *info);
  309. 00490
  310. 00497 <font class="keywordtype">bool</font> probeDeviceOpen(<font class="keywordtype">int</font> device, RTAUDIO_STREAM *stream,
  311. 00498 STREAM_MODE mode, <font class="keywordtype">int</font> channels,
  312. 00499 <font class="keywordtype">int</font> sampleRate, RTAUDIO_FORMAT format,
  313. 00500 <font class="keywordtype">int</font> *bufferSize, <font class="keywordtype">int</font> numberOfBuffers);
  314. 00501
  315. 00508 <font class="keywordtype">void</font> *verifyStream(<font class="keywordtype">int</font> streamId);
  316. 00509
  317. 00514 <font class="keywordtype">void</font> convertStreamBuffer(RTAUDIO_STREAM *stream, STREAM_MODE mode);
  318. 00515
  319. 00517 <font class="keywordtype">void</font> byteSwapBuffer(<font class="keywordtype">char</font> *buffer, <font class="keywordtype">int</font> samples, RTAUDIO_FORMAT format);
  320. 00518
  321. 00520 <font class="keywordtype">int</font> formatBytes(RTAUDIO_FORMAT format);
  322. 00521 };
  323. 00522
  324. 00523 <font class="comment">// Define the following flag to have extra information spewed to stderr.</font>
  325. 00524 <font class="comment">//#define __RTAUDIO_DEBUG__</font>
  326. 00525
  327. 00526 <font class="preprocessor">#endif</font>
  328. </font></pre></div><HR>
  329. <table><tr><td><img src="../images/ccrma.gif">
  330. <td>&copy;2001-2002 Gary P. Scavone, CCRMA, Stanford University. All Rights Reserved.<br>
  331. Maintained by Gary P. Scavone, <a href="mailto:gary@ccrma.stanford.edu">gary@ccrma.stanford.edu</a><P>
  332. </table>
  333. </BODY>
  334. </HTML>