~ubuntu-branches/ubuntu/gutsy/audacity/gutsy-backports

« back to all changes in this revision

Viewing changes to lib-src/rtaudio/doc/html/classRtAudio.html

  • Committer: Bazaar Package Importer
  • Author(s): John Dong
  • Date: 2008-02-18 21:58:19 UTC
  • mfrom: (13.1.2 hardy)
  • Revision ID: james.westby@ubuntu.com-20080218215819-tmbcf1rx238r8gdv
Tags: 1.3.4-1.1ubuntu1~gutsy1
Automated backport upload; no source changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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.3.4 -->
11
 
<h1>RtAudio Class Reference</h1>Realtime audio i/o C++ classes.  
12
 
<a href="#_details">More...</a>
13
 
<p>
14
 
<code>#include &lt;<a class="el" href="RtAudio_8h-source.html">RtAudio.h</a>&gt;</code>
15
 
<p>
16
 
<a href="classRtAudio-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
17
 
<tr><td></td></tr>
18
 
<tr><td colspan=2><br><h2>Public Types</h2></td></tr>
19
 
<tr><td class="memItemLeft" nowrap align=right valign=top>enum &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#w8">RtAudioApi</a> { <br>
20
 
&nbsp;&nbsp;<a class="el" href="classRtAudio.html#w8w0">UNSPECIFIED</a>, 
21
 
<a class="el" href="classRtAudio.html#w8w1">LINUX_ALSA</a>, 
22
 
<a class="el" href="classRtAudio.html#w8w2">LINUX_OSS</a>, 
23
 
<a class="el" href="classRtAudio.html#w8w3">LINUX_JACK</a>, 
24
 
<br>
25
 
&nbsp;&nbsp;<a class="el" href="classRtAudio.html#w8w4">MACOSX_CORE</a>, 
26
 
<a class="el" href="classRtAudio.html#w8w5">IRIX_AL</a>, 
27
 
<a class="el" href="classRtAudio.html#w8w6">WINDOWS_ASIO</a>, 
28
 
<a class="el" href="classRtAudio.html#w8w7">WINDOWS_DS</a>
29
 
<br>
30
 
 }</td></tr>
31
 
 
32
 
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Audio API specifier arguments. </em> <a href="#w8">More...</a><em><br><br></td></tr>
33
 
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
34
 
<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">RtAudioApi</a> api=UNSPECIFIED)</td></tr>
35
 
 
36
 
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The default class constructor. </em> <a href="#a0"></a><em><br><br></td></tr>
37
 
<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> (int outputDevice, int outputChannels, int inputDevice, int inputChannels, RtAudioFormat format, int sampleRate, int *bufferSize, int numberOfBuffers, <a class="el" href="classRtAudio.html#w8">RtAudioApi</a> api=UNSPECIFIED)</td></tr>
38
 
 
39
 
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A constructor which can be used to open a stream during instantiation. </em> <a href="#a1"></a><em><br><br></td></tr>
40
 
<tr><td class="memItemLeft" nowrap align=right valign=top>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a2">~RtAudio</a> ()</td></tr>
41
 
 
42
 
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">The destructor. </em> <a href="#a2"></a><em><br><br></td></tr>
43
 
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a3">openStream</a> (int outputDevice, int outputChannels, int inputDevice, int inputChannels, RtAudioFormat format, int sampleRate, int *bufferSize, int numberOfBuffers)</td></tr>
44
 
 
45
 
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A public method for opening a stream with the specified parameters. </em> <a href="#a3"></a><em><br><br></td></tr>
46
 
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a4">setStreamCallback</a> (RtAudioCallback callback, void *userData)</td></tr>
47
 
 
48
 
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A public method which sets a user-defined callback function for a given stream. </em> <a href="#a4"></a><em><br><br></td></tr>
49
 
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a5">cancelStreamCallback</a> ()</td></tr>
50
 
 
51
 
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A public method which cancels a callback process and function for the stream. </em> <a href="#a5"></a><em><br><br></td></tr>
52
 
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="anchor" name="a6" doxytag="RtAudio::getDeviceCount" ></a>
53
 
int&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a6">getDeviceCount</a> (void)</td></tr>
54
 
 
55
 
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A public method which returns the number of audio devices found. <br><br></td></tr>
56
 
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a>&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a7">getDeviceInfo</a> (int device)</td></tr>
57
 
 
58
 
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Return an <a class="el" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a> structure for a specified device number. </em> <a href="#a7"></a><em><br><br></td></tr>
59
 
<tr><td class="memItemLeft" nowrap align=right valign=top>char *const &nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a8">getStreamBuffer</a> ()</td></tr>
60
 
 
61
 
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">A public method which returns a pointer to the buffer for an open stream. </em> <a href="#a8"></a><em><br><br></td></tr>
62
 
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a9">tickStream</a> ()</td></tr>
63
 
 
64
 
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Public method used to trigger processing of input/output data for a stream. </em> <a href="#a9"></a><em><br><br></td></tr>
65
 
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a10">closeStream</a> ()</td></tr>
66
 
 
67
 
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Public method which closes a stream and frees any associated buffers. </em> <a href="#a10"></a><em><br><br></td></tr>
68
 
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a11">startStream</a> ()</td></tr>
69
 
 
70
 
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Public method which starts a stream. </em> <a href="#a11"></a><em><br><br></td></tr>
71
 
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a12">stopStream</a> ()</td></tr>
72
 
 
73
 
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Stop a stream, allowing any samples remaining in the queue to be played out and/or read in. </em> <a href="#a12"></a><em><br><br></td></tr>
74
 
<tr><td class="memItemLeft" nowrap align=right valign=top>void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="classRtAudio.html#a13">abortStream</a> ()</td></tr>
75
 
 
76
 
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Stop a stream, discarding any samples remaining in the input/output queue. </em> <a href="#a13"></a><em><br><br></td></tr>
77
 
</table>
78
 
<hr><a name="_details"></a><h2>Detailed Description</h2>
79
 
Realtime audio i/o C++ classes. 
80
 
<p>
81
 
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 Windows (DirectSound and ASIO) operating systems.<p>
82
 
RtAudio WWW site: <a href="http://music.mcgill.ca/~gary/rtaudio/">http://music.mcgill.ca/~gary/rtaudio/</a><p>
83
 
RtAudio: a realtime audio i/o C++ class Copyright (c) 2001-2004 Gary P. Scavone<p>
84
 
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>
85
 
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.<p>
86
 
Any person wishing to distribute modifications to the Software is requested to send the modifications to the original developer so that they can be incorporated into the canonical version.<p>
87
 
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. 
88
 
<p>
89
 
<hr><h2>Member Enumeration Documentation</h2>
90
 
<a class="anchor" name="w8" doxytag="RtAudio::RtAudioApi" ></a><p>
91
 
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
92
 
  <tr>
93
 
    <td class="mdRow">
94
 
      <table cellpadding="0" cellspacing="0" border="0">
95
 
        <tr>
96
 
          <td class="md" nowrap valign="top"> enum <a class="el" href="classRtAudio.html#w8">RtAudio::RtAudioApi</a>
97
 
      </table>
98
 
    </td>
99
 
  </tr>
100
 
</table>
101
 
<table cellspacing=5 cellpadding=0 border=0>
102
 
  <tr>
103
 
    <td>
104
 
      &nbsp;
105
 
    </td>
106
 
    <td>
107
 
 
108
 
<p>
109
 
Audio API specifier arguments. 
110
 
<p>
111
 
<dl compact><dt><b>Enumeration values: </b></dt><dd>
112
 
<table border=0 cellspacing=2 cellpadding=0>
113
 
<tr><td valign=top><em><a class="anchor" name="w8w0" doxytag="UNSPECIFIED" ></a>UNSPECIFIED</em>&nbsp;</td><td>
114
 
Search for a working compiled API. </td></tr>
115
 
<tr><td valign=top><em><a class="anchor" name="w8w1" doxytag="LINUX_ALSA" ></a>LINUX_ALSA</em>&nbsp;</td><td>
116
 
The Advanced Linux Sound Architecture API. </td></tr>
117
 
<tr><td valign=top><em><a class="anchor" name="w8w2" doxytag="LINUX_OSS" ></a>LINUX_OSS</em>&nbsp;</td><td>
118
 
The Linux Open Sound System API. </td></tr>
119
 
<tr><td valign=top><em><a class="anchor" name="w8w3" doxytag="LINUX_JACK" ></a>LINUX_JACK</em>&nbsp;</td><td>
120
 
The Linux Jack Low-Latency Audio Server API. </td></tr>
121
 
<tr><td valign=top><em><a class="anchor" name="w8w4" doxytag="MACOSX_CORE" ></a>MACOSX_CORE</em>&nbsp;</td><td>
122
 
Macintosh OS-X Core Audio API. </td></tr>
123
 
<tr><td valign=top><em><a class="anchor" name="w8w5" doxytag="IRIX_AL" ></a>IRIX_AL</em>&nbsp;</td><td>
124
 
The Irix Audio Library API. </td></tr>
125
 
<tr><td valign=top><em><a class="anchor" name="w8w6" doxytag="WINDOWS_ASIO" ></a>WINDOWS_ASIO</em>&nbsp;</td><td>
126
 
The Steinberg Audio Stream I/O API. </td></tr>
127
 
<tr><td valign=top><em><a class="anchor" name="w8w7" doxytag="WINDOWS_DS" ></a>WINDOWS_DS</em>&nbsp;</td><td>
128
 
The Microsoft Direct Sound API. </td></tr>
129
 
</table>
130
 
</dl>
131
 
    </td>
132
 
  </tr>
133
 
</table>
134
 
<hr><h2>Constructor &amp; Destructor Documentation</h2>
135
 
<a class="anchor" name="a0" doxytag="RtAudio::RtAudio" ></a><p>
136
 
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
137
 
  <tr>
138
 
    <td class="mdRow">
139
 
      <table cellpadding="0" cellspacing="0" border="0">
140
 
        <tr>
141
 
          <td class="md" nowrap valign="top"> RtAudio::RtAudio </td>
142
 
          <td class="md" valign="top">(&nbsp;</td>
143
 
          <td class="md" nowrap valign="top"><a class="el" href="classRtAudio.html#w8">RtAudioApi</a>&nbsp;</td>
144
 
          <td class="mdname1" valign="top" nowrap> <em>api</em> = UNSPECIFIED          </td>
145
 
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
146
 
          <td class="md" nowrap></td>
147
 
        </tr>
148
 
 
149
 
      </table>
150
 
    </td>
151
 
  </tr>
152
 
</table>
153
 
<table cellspacing=5 cellpadding=0 border=0>
154
 
  <tr>
155
 
    <td>
156
 
      &nbsp;
157
 
    </td>
158
 
    <td>
159
 
 
160
 
<p>
161
 
The default class constructor. 
162
 
<p>
163
 
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="classRtError.html">RtError</a> error can be thrown if no devices are found or if a memory allocation error occurs.<p>
164
 
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>
165
 
  </tr>
166
 
</table>
167
 
<a class="anchor" name="a1" doxytag="RtAudio::RtAudio" ></a><p>
168
 
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
169
 
  <tr>
170
 
    <td class="mdRow">
171
 
      <table cellpadding="0" cellspacing="0" border="0">
172
 
        <tr>
173
 
          <td class="md" nowrap valign="top"> RtAudio::RtAudio </td>
174
 
          <td class="md" valign="top">(&nbsp;</td>
175
 
          <td class="md" nowrap valign="top">int&nbsp;</td>
176
 
          <td class="mdname" nowrap> <em>outputDevice</em>, </td>
177
 
        </tr>
178
 
        <tr>
179
 
          <td></td>
180
 
          <td></td>
181
 
          <td class="md" nowrap>int&nbsp;</td>
182
 
          <td class="mdname" nowrap> <em>outputChannels</em>, </td>
183
 
        </tr>
184
 
        <tr>
185
 
          <td></td>
186
 
          <td></td>
187
 
          <td class="md" nowrap>int&nbsp;</td>
188
 
          <td class="mdname" nowrap> <em>inputDevice</em>, </td>
189
 
        </tr>
190
 
        <tr>
191
 
          <td></td>
192
 
          <td></td>
193
 
          <td class="md" nowrap>int&nbsp;</td>
194
 
          <td class="mdname" nowrap> <em>inputChannels</em>, </td>
195
 
        </tr>
196
 
        <tr>
197
 
          <td></td>
198
 
          <td></td>
199
 
          <td class="md" nowrap>RtAudioFormat&nbsp;</td>
200
 
          <td class="mdname" nowrap> <em>format</em>, </td>
201
 
        </tr>
202
 
        <tr>
203
 
          <td></td>
204
 
          <td></td>
205
 
          <td class="md" nowrap>int&nbsp;</td>
206
 
          <td class="mdname" nowrap> <em>sampleRate</em>, </td>
207
 
        </tr>
208
 
        <tr>
209
 
          <td></td>
210
 
          <td></td>
211
 
          <td class="md" nowrap>int *&nbsp;</td>
212
 
          <td class="mdname" nowrap> <em>bufferSize</em>, </td>
213
 
        </tr>
214
 
        <tr>
215
 
          <td></td>
216
 
          <td></td>
217
 
          <td class="md" nowrap>int&nbsp;</td>
218
 
          <td class="mdname" nowrap> <em>numberOfBuffers</em>, </td>
219
 
        </tr>
220
 
        <tr>
221
 
          <td></td>
222
 
          <td></td>
223
 
          <td class="md" nowrap><a class="el" href="classRtAudio.html#w8">RtAudioApi</a>&nbsp;</td>
224
 
          <td class="mdname" nowrap> <em>api</em> = UNSPECIFIED</td>
225
 
        </tr>
226
 
        <tr>
227
 
          <td></td>
228
 
          <td class="md">)&nbsp;</td>
229
 
          <td class="md" colspan="2"></td>
230
 
        </tr>
231
 
 
232
 
      </table>
233
 
    </td>
234
 
  </tr>
235
 
</table>
236
 
<table cellspacing=5 cellpadding=0 border=0>
237
 
  <tr>
238
 
    <td>
239
 
      &nbsp;
240
 
    </td>
241
 
    <td>
242
 
 
243
 
<p>
244
 
A constructor which can be used to open a stream during instantiation. 
245
 
<p>
246
 
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="classRtError.html">RtError</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><b>See also:</b></dt><dd><a class="el" href="classRtAudio.html#a3">openStream()</a> </dd></dl>
247
 
    </td>
248
 
  </tr>
249
 
</table>
250
 
<a class="anchor" name="a2" doxytag="RtAudio::~RtAudio" ></a><p>
251
 
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
252
 
  <tr>
253
 
    <td class="mdRow">
254
 
      <table cellpadding="0" cellspacing="0" border="0">
255
 
        <tr>
256
 
          <td class="md" nowrap valign="top"> RtAudio::~<a class="el" href="classRtAudio.html">RtAudio</a> </td>
257
 
          <td class="md" valign="top">(&nbsp;</td>
258
 
          <td class="mdname1" valign="top" nowrap>          </td>
259
 
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
260
 
          <td class="md" nowrap></td>
261
 
        </tr>
262
 
 
263
 
      </table>
264
 
    </td>
265
 
  </tr>
266
 
</table>
267
 
<table cellspacing=5 cellpadding=0 border=0>
268
 
  <tr>
269
 
    <td>
270
 
      &nbsp;
271
 
    </td>
272
 
    <td>
273
 
 
274
 
<p>
275
 
The destructor. 
276
 
<p>
277
 
Stops and closes an open stream and devices and deallocates buffer and structure memory.     </td>
278
 
  </tr>
279
 
</table>
280
 
<hr><h2>Member Function Documentation</h2>
281
 
<a class="anchor" name="a3" doxytag="RtAudio::openStream" ></a><p>
282
 
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
283
 
  <tr>
284
 
    <td class="mdRow">
285
 
      <table cellpadding="0" cellspacing="0" border="0">
286
 
        <tr>
287
 
          <td class="md" nowrap valign="top"> void RtAudio::openStream </td>
288
 
          <td class="md" valign="top">(&nbsp;</td>
289
 
          <td class="md" nowrap valign="top">int&nbsp;</td>
290
 
          <td class="mdname" nowrap> <em>outputDevice</em>, </td>
291
 
        </tr>
292
 
        <tr>
293
 
          <td></td>
294
 
          <td></td>
295
 
          <td class="md" nowrap>int&nbsp;</td>
296
 
          <td class="mdname" nowrap> <em>outputChannels</em>, </td>
297
 
        </tr>
298
 
        <tr>
299
 
          <td></td>
300
 
          <td></td>
301
 
          <td class="md" nowrap>int&nbsp;</td>
302
 
          <td class="mdname" nowrap> <em>inputDevice</em>, </td>
303
 
        </tr>
304
 
        <tr>
305
 
          <td></td>
306
 
          <td></td>
307
 
          <td class="md" nowrap>int&nbsp;</td>
308
 
          <td class="mdname" nowrap> <em>inputChannels</em>, </td>
309
 
        </tr>
310
 
        <tr>
311
 
          <td></td>
312
 
          <td></td>
313
 
          <td class="md" nowrap>RtAudioFormat&nbsp;</td>
314
 
          <td class="mdname" nowrap> <em>format</em>, </td>
315
 
        </tr>
316
 
        <tr>
317
 
          <td></td>
318
 
          <td></td>
319
 
          <td class="md" nowrap>int&nbsp;</td>
320
 
          <td class="mdname" nowrap> <em>sampleRate</em>, </td>
321
 
        </tr>
322
 
        <tr>
323
 
          <td></td>
324
 
          <td></td>
325
 
          <td class="md" nowrap>int *&nbsp;</td>
326
 
          <td class="mdname" nowrap> <em>bufferSize</em>, </td>
327
 
        </tr>
328
 
        <tr>
329
 
          <td></td>
330
 
          <td></td>
331
 
          <td class="md" nowrap>int&nbsp;</td>
332
 
          <td class="mdname" nowrap> <em>numberOfBuffers</em></td>
333
 
        </tr>
334
 
        <tr>
335
 
          <td></td>
336
 
          <td class="md">)&nbsp;</td>
337
 
          <td class="md" colspan="2"></td>
338
 
        </tr>
339
 
 
340
 
      </table>
341
 
    </td>
342
 
  </tr>
343
 
</table>
344
 
<table cellspacing=5 cellpadding=0 border=0>
345
 
  <tr>
346
 
    <td>
347
 
      &nbsp;
348
 
    </td>
349
 
    <td>
350
 
 
351
 
<p>
352
 
A public method for opening a stream with the specified parameters. 
353
 
<p>
354
 
An <a class="el" href="classRtError.html">RtError</a> is thrown if a stream cannot be opened.<p>
355
 
<dl compact><dt><b>Parameters:</b></dt><dd>
356
 
  <table border="0" cellspacing="2" cellpadding="0">
357
 
    <tr><td valign=top><em>outputDevice:</em>&nbsp;</td><td>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>
358
 
    <tr><td valign=top><em>outputChannels:</em>&nbsp;</td><td>The desired number of output channels. If equal to zero, the outputDevice identifier is ignored. </td></tr>
359
 
    <tr><td valign=top><em>inputDevice:</em>&nbsp;</td><td>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>
360
 
    <tr><td valign=top><em>inputChannels:</em>&nbsp;</td><td>The desired number of input channels. If equal to zero, the inputDevice identifier is ignored. </td></tr>
361
 
    <tr><td valign=top><em>format:</em>&nbsp;</td><td>An RtAudioFormat specifying the desired sample data format. </td></tr>
362
 
    <tr><td valign=top><em>sampleRate:</em>&nbsp;</td><td>The desired sample rate (sample frames per second). </td></tr>
363
 
    <tr><td valign=top><em>*bufferSize:</em>&nbsp;</td><td>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>
364
 
    <tr><td valign=top><em>numberOfBuffers:</em>&nbsp;</td><td>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>
365
 
  </table>
366
 
</dl>
367
 
    </td>
368
 
  </tr>
369
 
</table>
370
 
<a class="anchor" name="a4" doxytag="RtAudio::setStreamCallback" ></a><p>
371
 
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
372
 
  <tr>
373
 
    <td class="mdRow">
374
 
      <table cellpadding="0" cellspacing="0" border="0">
375
 
        <tr>
376
 
          <td class="md" nowrap valign="top"> void RtAudio::setStreamCallback </td>
377
 
          <td class="md" valign="top">(&nbsp;</td>
378
 
          <td class="md" nowrap valign="top">RtAudioCallback&nbsp;</td>
379
 
          <td class="mdname" nowrap> <em>callback</em>, </td>
380
 
        </tr>
381
 
        <tr>
382
 
          <td></td>
383
 
          <td></td>
384
 
          <td class="md" nowrap>void *&nbsp;</td>
385
 
          <td class="mdname" nowrap> <em>userData</em></td>
386
 
        </tr>
387
 
        <tr>
388
 
          <td></td>
389
 
          <td class="md">)&nbsp;</td>
390
 
          <td class="md" colspan="2"><code> [inline]</code></td>
391
 
        </tr>
392
 
 
393
 
      </table>
394
 
    </td>
395
 
  </tr>
396
 
</table>
397
 
<table cellspacing=5 cellpadding=0 border=0>
398
 
  <tr>
399
 
    <td>
400
 
      &nbsp;
401
 
    </td>
402
 
    <td>
403
 
 
404
 
<p>
405
 
A public method which sets a user-defined callback function for a given stream. 
406
 
<p>
407
 
This method assigns a callback function to a 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 the stream can use only blocking or callback functionality at a particular 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="classRtError.html">RtError</a> will be thrown if called when no stream is open or a thread errors occurs.     </td>
408
 
  </tr>
409
 
</table>
410
 
<a class="anchor" name="a5" doxytag="RtAudio::cancelStreamCallback" ></a><p>
411
 
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
412
 
  <tr>
413
 
    <td class="mdRow">
414
 
      <table cellpadding="0" cellspacing="0" border="0">
415
 
        <tr>
416
 
          <td class="md" nowrap valign="top"> void RtAudio::cancelStreamCallback </td>
417
 
          <td class="md" valign="top">(&nbsp;</td>
418
 
          <td class="mdname1" valign="top" nowrap>          </td>
419
 
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
420
 
          <td class="md" nowrap><code> [inline]</code></td>
421
 
        </tr>
422
 
 
423
 
      </table>
424
 
    </td>
425
 
  </tr>
426
 
</table>
427
 
<table cellspacing=5 cellpadding=0 border=0>
428
 
  <tr>
429
 
    <td>
430
 
      &nbsp;
431
 
    </td>
432
 
    <td>
433
 
 
434
 
<p>
435
 
A public method which cancels a callback process and function for the stream. 
436
 
<p>
437
 
This method shuts down a callback process and de-references the user function for the 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="classRtError.html">RtError</a> will be thrown if called when no stream is open.     </td>
438
 
  </tr>
439
 
</table>
440
 
<a class="anchor" name="a7" doxytag="RtAudio::getDeviceInfo" ></a><p>
441
 
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
442
 
  <tr>
443
 
    <td class="mdRow">
444
 
      <table cellpadding="0" cellspacing="0" border="0">
445
 
        <tr>
446
 
          <td class="md" nowrap valign="top"> <a class="el" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a> RtAudio::getDeviceInfo </td>
447
 
          <td class="md" valign="top">(&nbsp;</td>
448
 
          <td class="md" nowrap valign="top">int&nbsp;</td>
449
 
          <td class="mdname1" valign="top" nowrap> <em>device</em>          </td>
450
 
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
451
 
          <td class="md" nowrap><code> [inline]</code></td>
452
 
        </tr>
453
 
 
454
 
      </table>
455
 
    </td>
456
 
  </tr>
457
 
</table>
458
 
<table cellspacing=5 cellpadding=0 border=0>
459
 
  <tr>
460
 
    <td>
461
 
      &nbsp;
462
 
    </td>
463
 
    <td>
464
 
 
465
 
<p>
466
 
Return an <a class="el" href="structRtAudioDeviceInfo.html">RtAudioDeviceInfo</a> structure for a specified device number. 
467
 
<p>
468
 
Any device integer between 1 and <a class="el" href="classRtAudio.html#a6">getDeviceCount()</a> is valid. 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 "isDefault" member will have a value of "true". An <a class="el" href="classRtError.html">RtError</a> will be thrown for an invalid device argument.     </td>
469
 
  </tr>
470
 
</table>
471
 
<a class="anchor" name="a8" doxytag="RtAudio::getStreamBuffer" ></a><p>
472
 
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
473
 
  <tr>
474
 
    <td class="mdRow">
475
 
      <table cellpadding="0" cellspacing="0" border="0">
476
 
        <tr>
477
 
          <td class="md" nowrap valign="top"> char* const RtAudio::getStreamBuffer </td>
478
 
          <td class="md" valign="top">(&nbsp;</td>
479
 
          <td class="mdname1" valign="top" nowrap>          </td>
480
 
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
481
 
          <td class="md" nowrap><code> [inline]</code></td>
482
 
        </tr>
483
 
 
484
 
      </table>
485
 
    </td>
486
 
  </tr>
487
 
</table>
488
 
<table cellspacing=5 cellpadding=0 border=0>
489
 
  <tr>
490
 
    <td>
491
 
      &nbsp;
492
 
    </td>
493
 
    <td>
494
 
 
495
 
<p>
496
 
A public method which returns a pointer to the buffer for an open stream. 
497
 
<p>
498
 
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="classRtError.html">RtError</a> will be thrown if called when no stream is open.     </td>
499
 
  </tr>
500
 
</table>
501
 
<a class="anchor" name="a9" doxytag="RtAudio::tickStream" ></a><p>
502
 
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
503
 
  <tr>
504
 
    <td class="mdRow">
505
 
      <table cellpadding="0" cellspacing="0" border="0">
506
 
        <tr>
507
 
          <td class="md" nowrap valign="top"> void RtAudio::tickStream </td>
508
 
          <td class="md" valign="top">(&nbsp;</td>
509
 
          <td class="mdname1" valign="top" nowrap>          </td>
510
 
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
511
 
          <td class="md" nowrap><code> [inline]</code></td>
512
 
        </tr>
513
 
 
514
 
      </table>
515
 
    </td>
516
 
  </tr>
517
 
</table>
518
 
<table cellspacing=5 cellpadding=0 border=0>
519
 
  <tr>
520
 
    <td>
521
 
      &nbsp;
522
 
    </td>
523
 
    <td>
524
 
 
525
 
<p>
526
 
Public method used to trigger processing of input/output data for a stream. 
527
 
<p>
528
 
This method blocks until all buffer data is read/written. An <a class="el" href="classRtError.html">RtError</a> will be thrown if a driver error occurs or if called when no stream is open.     </td>
529
 
  </tr>
530
 
</table>
531
 
<a class="anchor" name="a10" doxytag="RtAudio::closeStream" ></a><p>
532
 
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
533
 
  <tr>
534
 
    <td class="mdRow">
535
 
      <table cellpadding="0" cellspacing="0" border="0">
536
 
        <tr>
537
 
          <td class="md" nowrap valign="top"> void RtAudio::closeStream </td>
538
 
          <td class="md" valign="top">(&nbsp;</td>
539
 
          <td class="mdname1" valign="top" nowrap>          </td>
540
 
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
541
 
          <td class="md" nowrap><code> [inline]</code></td>
542
 
        </tr>
543
 
 
544
 
      </table>
545
 
    </td>
546
 
  </tr>
547
 
</table>
548
 
<table cellspacing=5 cellpadding=0 border=0>
549
 
  <tr>
550
 
    <td>
551
 
      &nbsp;
552
 
    </td>
553
 
    <td>
554
 
 
555
 
<p>
556
 
Public method which closes a stream and frees any associated buffers. 
557
 
<p>
558
 
If a stream is not open, this method issues a warning and returns (an <a class="el" href="classRtError.html">RtError</a> is not thrown).     </td>
559
 
  </tr>
560
 
</table>
561
 
<a class="anchor" name="a11" doxytag="RtAudio::startStream" ></a><p>
562
 
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
563
 
  <tr>
564
 
    <td class="mdRow">
565
 
      <table cellpadding="0" cellspacing="0" border="0">
566
 
        <tr>
567
 
          <td class="md" nowrap valign="top"> void RtAudio::startStream </td>
568
 
          <td class="md" valign="top">(&nbsp;</td>
569
 
          <td class="mdname1" valign="top" nowrap>          </td>
570
 
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
571
 
          <td class="md" nowrap><code> [inline]</code></td>
572
 
        </tr>
573
 
 
574
 
      </table>
575
 
    </td>
576
 
  </tr>
577
 
</table>
578
 
<table cellspacing=5 cellpadding=0 border=0>
579
 
  <tr>
580
 
    <td>
581
 
      &nbsp;
582
 
    </td>
583
 
    <td>
584
 
 
585
 
<p>
586
 
Public method which starts a stream. 
587
 
<p>
588
 
An <a class="el" href="classRtError.html">RtError</a> will be thrown if a driver error occurs or if called when no stream is open.     </td>
589
 
  </tr>
590
 
</table>
591
 
<a class="anchor" name="a12" doxytag="RtAudio::stopStream" ></a><p>
592
 
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
593
 
  <tr>
594
 
    <td class="mdRow">
595
 
      <table cellpadding="0" cellspacing="0" border="0">
596
 
        <tr>
597
 
          <td class="md" nowrap valign="top"> void RtAudio::stopStream </td>
598
 
          <td class="md" valign="top">(&nbsp;</td>
599
 
          <td class="mdname1" valign="top" nowrap>          </td>
600
 
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
601
 
          <td class="md" nowrap><code> [inline]</code></td>
602
 
        </tr>
603
 
 
604
 
      </table>
605
 
    </td>
606
 
  </tr>
607
 
</table>
608
 
<table cellspacing=5 cellpadding=0 border=0>
609
 
  <tr>
610
 
    <td>
611
 
      &nbsp;
612
 
    </td>
613
 
    <td>
614
 
 
615
 
<p>
616
 
Stop a stream, allowing any samples remaining in the queue to be played out and/or read in. 
617
 
<p>
618
 
An <a class="el" href="classRtError.html">RtError</a> will be thrown if a driver error occurs or if called when no stream is open.     </td>
619
 
  </tr>
620
 
</table>
621
 
<a class="anchor" name="a13" doxytag="RtAudio::abortStream" ></a><p>
622
 
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
623
 
  <tr>
624
 
    <td class="mdRow">
625
 
      <table cellpadding="0" cellspacing="0" border="0">
626
 
        <tr>
627
 
          <td class="md" nowrap valign="top"> void RtAudio::abortStream </td>
628
 
          <td class="md" valign="top">(&nbsp;</td>
629
 
          <td class="mdname1" valign="top" nowrap>          </td>
630
 
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
631
 
          <td class="md" nowrap><code> [inline]</code></td>
632
 
        </tr>
633
 
 
634
 
      </table>
635
 
    </td>
636
 
  </tr>
637
 
</table>
638
 
<table cellspacing=5 cellpadding=0 border=0>
639
 
  <tr>
640
 
    <td>
641
 
      &nbsp;
642
 
    </td>
643
 
    <td>
644
 
 
645
 
<p>
646
 
Stop a stream, discarding any samples remaining in the input/output queue. 
647
 
<p>
648
 
An <a class="el" href="classRtError.html">RtError</a> will be thrown if a driver error occurs or if called when no stream is open.     </td>
649
 
  </tr>
650
 
</table>
651
 
<hr>The documentation for this class was generated from the following file:<ul>
652
 
<li><a class="el" href="RtAudio_8h-source.html">RtAudio.h</a></ul>
653
 
<HR>
654
 
 
655
 
<table><tr><td><img src="../images/mcgill.gif" width=165></td>
656
 
  <td>&copy;2001-2004 Gary P. Scavone, McGill University. All Rights Reserved.<br>
657
 
  Maintained by Gary P. Scavone, <a href="mailto:gary@music.mcgill.ca">gary@music.mcgill.ca</a></td></tr>
658
 
</table>
659
 
 
660
 
</BODY>
661
 
</HTML>