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