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