summaryrefslogtreecommitdiff
path: root/doc/html/classRtAudio.html
blob: 4b2b2cd5379f89960be59cec7d7af75df8ab4357 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
<HTML>
<HEAD>
<TITLE>The RtAudio Home Page</TITLE>
<LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
<LINK REL="SHORTCUT ICON" HREF="http://www.music.mcgill.ca/~gary/favicon.ico">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<a class="qindex" href="index.html">Home</a> &nbsp; <a class="qindex" href="annotated.html">Class/Enum List</a> &nbsp; <a class="qindex" href="files.html">File List</a> &nbsp; <a class="qindex" href="functions.html">Compound Members</a> &nbsp; </CENTER>
<HR>
<!-- Generated by Doxygen 1.4.4 -->
<h1>RtAudio Class Reference</h1><!-- doxytag: class="RtAudio" -->Realtime audio i/o C++ classes.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="RtAudio_8h-source.html">RtAudio.h</a>&gt;</code>
<p>
<a href="classRtAudio-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">enum &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#w8">Api</a> { <br>
&nbsp;&nbsp;<a class="el" href="classRtAudio.html#w8w0">UNSPECIFIED</a>, 
<a class="el" href="classRtAudio.html#w8w1">LINUX_ALSA</a>, 
<a class="el" href="classRtAudio.html#w8w2">LINUX_OSS</a>, 
<a class="el" href="classRtAudio.html#w8w3">UNIX_JACK</a>, 
<br>
&nbsp;&nbsp;<a class="el" href="classRtAudio.html#w8w4">MACOSX_CORE</a>, 
<a class="el" href="classRtAudio.html#w8w5">WINDOWS_ASIO</a>, 
<a class="el" href="classRtAudio.html#w8w6">WINDOWS_DS</a>, 
<a class="el" href="classRtAudio.html#w8w7">RTAUDIO_DUMMY</a>
<br>
 }</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Audio API specifier arguments.  <a href="classRtAudio.html#w8">More...</a><br></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a0">RtAudio</a> (<a class="el" href="classRtAudio.html#w8">RtAudio::Api</a> api=UNSPECIFIED)  throw ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The class constructor.  <a href="#a0"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a1">~RtAudio</a> ()  throw ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The destructor.  <a href="#a1"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a2"></a><!-- doxytag: member="RtAudio::getCurrentApi" ref="a2" args="(void)" -->
<a class="el" href="classRtAudio.html#w8">RtAudio::Api</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a2">getCurrentApi</a> (void)  throw ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the audio API specifier for the current instance of RtAudio. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a3">getDeviceCount</a> (void)  throw ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A public function that queries for the number of audio devices available.  <a href="#a3"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="structRtAudio_1_1DeviceInfo.html">RtAudio::DeviceInfo</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a4">getDeviceInfo</a> (unsigned int device)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return an <a class="el" href="structRtAudio_1_1DeviceInfo.html">RtAudio::DeviceInfo</a> structure for a specified device number.  <a href="#a4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a5">getDefaultOutputDevice</a> (void)  throw ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A function that returns the index of the default output device.  <a href="#a5"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a6">getDefaultInputDevice</a> (void)  throw ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A function that returns the index of the default input device.  <a href="#a6"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a7">openStream</a> (<a class="el" href="structRtAudio_1_1StreamParameters.html">RtAudio::StreamParameters</a> *outputParameters, <a class="el" href="structRtAudio_1_1StreamParameters.html">RtAudio::StreamParameters</a> *inputParameters, <a class="el" href="RtAudio_8h.html#a1">RtAudioFormat</a> format, unsigned int sampleRate, unsigned int *bufferFrames, <a class="el" href="RtAudio_8h.html#a15">RtAudioCallback</a> callback, void *userData=NULL, <a class="el" href="structRtAudio_1_1StreamOptions.html">RtAudio::StreamOptions</a> *options=NULL)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A public function for opening a stream with the specified parameters.  <a href="#a7"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a8">closeStream</a> (void)  throw ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A function that closes a stream and frees any associated stream memory.  <a href="#a8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a9">startStream</a> (void)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A function that starts a stream.  <a href="#a9"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a10">stopStream</a> (void)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Stop a stream, allowing any samples remaining in the output queue to be played.  <a href="#a10"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a11">abortStream</a> (void)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Stop a stream, discarding any samples remaining in the input/output queue.  <a href="#a11"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a12"></a><!-- doxytag: member="RtAudio::isStreamOpen" ref="a12" args="(void)" -->
bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a12">isStreamOpen</a> (void)  throw ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true if a stream is open and false if not. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a13"></a><!-- doxytag: member="RtAudio::isStreamRunning" ref="a13" args="(void)" -->
bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a13">isStreamRunning</a> (void)  throw ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns true if the stream is running and false if it is stopped or not open. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">double&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a14">getStreamTime</a> (void)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the number of elapsed seconds since the stream was started.  <a href="#a14"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">long&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a15">getStreamLatency</a> (void)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the internal stream latency in sample frames.  <a href="#a15"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="a16"></a><!-- doxytag: member="RtAudio::showWarnings" ref="a16" args="(bool value=true)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#a16">showWarnings</a> (bool value=true)  throw ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Specify whether warning messages should be printed to stderr. <br></td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classRtAudio.html#e0">getCompiledApi</a> (std::vector&lt; <a class="el" href="classRtAudio.html#w8">RtAudio::Api</a> &gt; &amp;apis)  throw ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A static function to determine the available compiled audio APIs.  <a href="#e0"></a><br></td></tr>
<tr><td colspan="2"><br><h2>Classes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1DeviceInfo.html">DeviceInfo</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The public device information structure for returning queried values.  <a href="structRtAudio_1_1DeviceInfo.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1StreamOptions.html">StreamOptions</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The structure for specifying stream options.  <a href="structRtAudio_1_1StreamOptions.html#_details">More...</a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1StreamParameters.html">StreamParameters</a></td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The structure for specifying input or ouput stream parameters.  <a href="structRtAudio_1_1StreamParameters.html#_details">More...</a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Realtime audio i/o C++ classes. 
<p>
RtAudio provides a common API (Application Programming Interface) for realtime audio input/output across Linux (native ALSA, Jack, and OSS), SGI, Macintosh OS X (CoreAudio and Jack), and Windows (DirectSound and ASIO) operating systems.<p>
RtAudio WWW site: <a href="http://www.music.mcgill.ca/~gary/rtaudio/">http://www.music.mcgill.ca/~gary/rtaudio/</a><p>
RtAudio: realtime audio i/o C++ classes Copyright (c) 2001-2007 Gary P. Scavone<p>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:<p>
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.<p>
Any person wishing to distribute modifications to the Software is asked to send the modifications to the original developer so that they can be incorporated into the canonical version. This is, however, not a binding provision of this license.<p>
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
<p>
<hr><h2>Member Enumeration Documentation</h2>
<a class="anchor" name="w8"></a><!-- doxytag: member="RtAudio::Api" ref="w8" args="" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">enum <a class="el" href="classRtAudio.html#w8">RtAudio::Api</a>          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Audio API specifier arguments. 
<p>
<dl compact><dt><b>Enumerator: </b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"><em><a class="anchor" name="w8w0"></a><!-- doxytag: member="UNSPECIFIED" ref="w8w0" args="" -->UNSPECIFIED</em>&nbsp;</td><td>
Search for a working compiled API. </td></tr>
<tr><td valign="top"><em><a class="anchor" name="w8w1"></a><!-- doxytag: member="LINUX_ALSA" ref="w8w1" args="" -->LINUX_ALSA</em>&nbsp;</td><td>
The Advanced Linux Sound Architecture API. </td></tr>
<tr><td valign="top"><em><a class="anchor" name="w8w2"></a><!-- doxytag: member="LINUX_OSS" ref="w8w2" args="" -->LINUX_OSS</em>&nbsp;</td><td>
The Linux Open Sound System API. </td></tr>
<tr><td valign="top"><em><a class="anchor" name="w8w3"></a><!-- doxytag: member="UNIX_JACK" ref="w8w3" args="" -->UNIX_JACK</em>&nbsp;</td><td>
The Jack Low-Latency Audio Server API. </td></tr>
<tr><td valign="top"><em><a class="anchor" name="w8w4"></a><!-- doxytag: member="MACOSX_CORE" ref="w8w4" args="" -->MACOSX_CORE</em>&nbsp;</td><td>
Macintosh OS-X Core Audio API. </td></tr>
<tr><td valign="top"><em><a class="anchor" name="w8w5"></a><!-- doxytag: member="WINDOWS_ASIO" ref="w8w5" args="" -->WINDOWS_ASIO</em>&nbsp;</td><td>
The Steinberg Audio Stream I/O API. </td></tr>
<tr><td valign="top"><em><a class="anchor" name="w8w6"></a><!-- doxytag: member="WINDOWS_DS" ref="w8w6" args="" -->WINDOWS_DS</em>&nbsp;</td><td>
The Microsoft Direct Sound API. </td></tr>
<tr><td valign="top"><em><a class="anchor" name="w8w7"></a><!-- doxytag: member="RTAUDIO_DUMMY" ref="w8w7" args="" -->RTAUDIO_DUMMY</em>&nbsp;</td><td>
A compilable but non-functional API. </td></tr>
</table>
</dl>
    </td>
  </tr>
</table>
<hr><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" name="a0"></a><!-- doxytag: member="RtAudio::RtAudio" ref="a0" args="(RtAudio::Api api=UNSPECIFIED)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">RtAudio::RtAudio           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="classRtAudio.html#w8">RtAudio::Api</a>&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>api</em> = <code>UNSPECIFIED</code>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>  throw ()</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The class constructor. 
<p>
The constructor performs minor initialization tasks. No exceptions can be thrown.<p>
If no API argument is specified and multiple API support has been compiled, the default order of use is JACK, ALSA, OSS (Linux systems) and ASIO, DS (Windows systems).    </td>
  </tr>
</table>
<a class="anchor" name="a1"></a><!-- doxytag: member="RtAudio::~RtAudio" ref="a1" args="()" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">RtAudio::~RtAudio           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>  throw ()</td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
The destructor. 
<p>
If a stream is running or open, it will be stopped and closed automatically.    </td>
  </tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="e0"></a><!-- doxytag: member="RtAudio::getCompiledApi" ref="e0" args="(std::vector&lt; RtAudio::Api &gt; &amp;apis)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">static void RtAudio::getCompiledApi           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">std::vector&lt; <a class="el" href="classRtAudio.html#w8">RtAudio::Api</a> &gt; &amp;&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>apis</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>  throw ()<code> [static]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
A static function to determine the available compiled audio APIs. 
<p>
The values returned in the std::vector can be compared against the enumerated list values. Note that there can be more than one API compiled for certain operating systems.    </td>
  </tr>
</table>
<a class="anchor" name="a3"></a><!-- doxytag: member="RtAudio::getDeviceCount" ref="a3" args="(void)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">unsigned int RtAudio::getDeviceCount           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>  throw ()<code> [inline]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
A public function that queries for the number of audio devices available. 
<p>
This function performs a system query of available devices each time it is called, thus supporting devices connected <em>after</em> instantiation. If a system error occurs during processing, a warning will be issued.    </td>
  </tr>
</table>
<a class="anchor" name="a4"></a><!-- doxytag: member="RtAudio::getDeviceInfo" ref="a4" args="(unsigned int device)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"><a class="el" href="structRtAudio_1_1DeviceInfo.html">RtAudio::DeviceInfo</a> RtAudio::getDeviceInfo           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">unsigned int&nbsp;</td>
          <td class="mdname1" valign="top" nowrap> <em>device</em>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [inline]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Return an <a class="el" href="structRtAudio_1_1DeviceInfo.html">RtAudio::DeviceInfo</a> structure for a specified device number. 
<p>
Any device integer between 0 and <a class="el" href="classRtAudio.html#a3">getDeviceCount()</a> - 1 is valid. If an invalid argument is provided, an <a class="el" href="classRtError.html">RtError</a> (type = INVALID_USE) will be thrown. If a device is busy or otherwise unavailable, the structure member "probed" will have a value of "false" and all other members are undefined. If the specified device is the current default input or output device, the corresponding "isDefault" member will have a value of "true".    </td>
  </tr>
</table>
<a class="anchor" name="a5"></a><!-- doxytag: member="RtAudio::getDefaultOutputDevice" ref="a5" args="(void)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">unsigned int RtAudio::getDefaultOutputDevice           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>  throw ()<code> [inline]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
A function that returns the index of the default output device. 
<p>
If the underlying audio API does not provide a "default device", or if no devices are available, the return value will be 0. Note that this is a valid device identifier and it is the client's responsibility to verify that a device is available before attempting to open a stream.    </td>
  </tr>
</table>
<a class="anchor" name="a6"></a><!-- doxytag: member="RtAudio::getDefaultInputDevice" ref="a6" args="(void)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">unsigned int RtAudio::getDefaultInputDevice           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>  throw ()<code> [inline]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
A function that returns the index of the default input device. 
<p>
If the underlying audio API does not provide a "default device", or if no devices are available, the return value will be 0. Note that this is a valid device identifier and it is the client's responsibility to verify that a device is available before attempting to open a stream.    </td>
  </tr>
</table>
<a class="anchor" name="a7"></a><!-- doxytag: member="RtAudio::openStream" ref="a7" args="(RtAudio::StreamParameters *outputParameters, RtAudio::StreamParameters *inputParameters, RtAudioFormat format, unsigned int sampleRate, unsigned int *bufferFrames, RtAudioCallback callback, void *userData=NULL, RtAudio::StreamOptions *options=NULL)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void RtAudio::openStream           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top"><a class="el" href="structRtAudio_1_1StreamParameters.html">RtAudio::StreamParameters</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>outputParameters</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="structRtAudio_1_1StreamParameters.html">RtAudio::StreamParameters</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>inputParameters</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="RtAudio_8h.html#a1">RtAudioFormat</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>format</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>unsigned int&nbsp;</td>
          <td class="mdname" nowrap> <em>sampleRate</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>unsigned int *&nbsp;</td>
          <td class="mdname" nowrap> <em>bufferFrames</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="RtAudio_8h.html#a15">RtAudioCallback</a>&nbsp;</td>
          <td class="mdname" nowrap> <em>callback</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap>void *&nbsp;</td>
          <td class="mdname" nowrap> <em>userData</em> = <code>NULL</code>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td class="md"></td>
          <td class="md" nowrap><a class="el" href="structRtAudio_1_1StreamOptions.html">RtAudio::StreamOptions</a> *&nbsp;</td>
          <td class="mdname" nowrap> <em>options</em> = <code>NULL</code></td>
        </tr>
        <tr>
          <td class="md"></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
A public function for opening a stream with the specified parameters. 
<p>
An <a class="el" href="classRtError.html">RtError</a> (type = SYSTEM_ERROR) is thrown if a stream cannot be opened with the specified parameters or an error occurs during processing. An <a class="el" href="classRtError.html">RtError</a> (type = INVALID_USE) is thrown if any invalid device ID or channel number parameters are specified.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
  <table border="0" cellspacing="2" cellpadding="0">
    <tr><td valign="top"></td><td valign="top"><em>outputParameters</em>&nbsp;</td><td>Specifies output stream parameters to use when opening a stream, including a device ID, number of channels, and starting channel number. For input-only streams, this argument should be NULL. The device ID is an index value between 0 and <a class="el" href="classRtAudio.html#a3">getDeviceCount()</a> - 1. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>inputParameters</em>&nbsp;</td><td>Specifies input stream parameters to use when opening a stream, including a device ID, number of channels, and starting channel number. For output-only streams, this argument should be NULL. The device ID is an index value between 0 and <a class="el" href="classRtAudio.html#a3">getDeviceCount()</a> - 1. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>format</em>&nbsp;</td><td>An RtAudioFormat specifying the desired sample data format. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>sampleRate</em>&nbsp;</td><td>The desired sample rate (sample frames per second). </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>*bufferFrames</em>&nbsp;</td><td>A pointer to a value indicating the desired internal buffer size in sample frames. The actual value used by the device is returned via the same pointer. A value of zero can be specified, in which case the lowest allowable value is determined. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>callback</em>&nbsp;</td><td>A client-defined function that will be invoked when input data is available and/or output data is needed. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>userData</em>&nbsp;</td><td>An optional pointer to data that can be accessed from within the callback function. </td></tr>
    <tr><td valign="top"></td><td valign="top"><em>options</em>&nbsp;</td><td>An optional pointer to a structure containing various global stream options, including a list of OR'ed RtAudioStreamFlags and a suggested number of stream buffers that can be used to control stream latency. More buffers typically result in more robust performance, though at a cost of greater latency. If a value of zero is specified, a system-specific median value is chosen. If the RTAUDIO_MINIMIZE_LATENCY flag bit is set, the lowest allowable value is used. The actual value used is returned via the structure argument. The parameter is API dependent.</td></tr>
  </table>
</dl>
    </td>
  </tr>
</table>
<a class="anchor" name="a8"></a><!-- doxytag: member="RtAudio::closeStream" ref="a8" args="(void)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void RtAudio::closeStream           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap>  throw ()<code> [inline]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
A function that closes a stream and frees any associated stream memory. 
<p>
If a stream is not open, this function issues a warning and returns (no exception is thrown).    </td>
  </tr>
</table>
<a class="anchor" name="a9"></a><!-- doxytag: member="RtAudio::startStream" ref="a9" args="(void)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void RtAudio::startStream           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [inline]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
A function that starts a stream. 
<p>
An <a class="el" href="classRtError.html">RtError</a> (type = SYSTEM_ERROR) is thrown if an error occurs during processing. An <a class="el" href="classRtError.html">RtError</a> (type = INVALID_USE) is thrown if a stream is not open. A warning is issued if the stream is already running.    </td>
  </tr>
</table>
<a class="anchor" name="a10"></a><!-- doxytag: member="RtAudio::stopStream" ref="a10" args="(void)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void RtAudio::stopStream           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [inline]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Stop a stream, allowing any samples remaining in the output queue to be played. 
<p>
An <a class="el" href="classRtError.html">RtError</a> (type = SYSTEM_ERROR) is thrown if an error occurs during processing. An <a class="el" href="classRtError.html">RtError</a> (type = INVALID_USE) is thrown if a stream is not open. A warning is issued if the stream is already stopped.    </td>
  </tr>
</table>
<a class="anchor" name="a11"></a><!-- doxytag: member="RtAudio::abortStream" ref="a11" args="(void)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">void RtAudio::abortStream           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [inline]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Stop a stream, discarding any samples remaining in the input/output queue. 
<p>
An <a class="el" href="classRtError.html">RtError</a> (type = SYSTEM_ERROR) is thrown if an error occurs during processing. An <a class="el" href="classRtError.html">RtError</a> (type = INVALID_USE) is thrown if a stream is not open. A warning is issued if the stream is already stopped.    </td>
  </tr>
</table>
<a class="anchor" name="a14"></a><!-- doxytag: member="RtAudio::getStreamTime" ref="a14" args="(void)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">double RtAudio::getStreamTime           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [inline]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Returns the number of elapsed seconds since the stream was started. 
<p>
If a stream is not open, an <a class="el" href="classRtError.html">RtError</a> (type = INVALID_USE) will be thrown.    </td>
  </tr>
</table>
<a class="anchor" name="a15"></a><!-- doxytag: member="RtAudio::getStreamLatency" ref="a15" args="(void)" --><p>
<table class="mdTable" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top">long RtAudio::getStreamLatency           </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">void&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [inline]</code></td>
        </tr>
      </table>
    </td>
  </tr>
</table>
<table cellspacing="5" cellpadding="0" border="0">
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
Returns the internal stream latency in sample frames. 
<p>
The stream latency refers to delay in audio input and/or output caused by internal buffering by the audio system and/or hardware. For duplex streams, the returned value will represent the sum of the input and output latencies. If a stream is not open, an <a class="el" href="classRtError.html">RtError</a> (type = INVALID_USE) will be thrown. If the API does not report latency, the return value will be zero.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="RtAudio_8h-source.html">RtAudio.h</a></ul>
<HR>

<table><tr><td><img src="../images/mcgill.gif" width=165></td>
  <td>&copy;2001-2007 Gary P. Scavone, McGill University. All Rights Reserved.<br>Maintained by <a href="http://www.music.mcgill.ca/~gary/">Gary P. Scavone</a>.</td></tr>
</table>

</BODY>
</HTML>