Release 4.0.0 tarball
[rtaudio.git] / doc / html / structRtAudio_1_1StreamOptions.html
1 <HTML>
2 <HEAD>
3 <TITLE>The RtAudio Home Page</TITLE>
4 <LINK HREF="doxygen.css" REL="stylesheet" TYPE="text/css">
5 <LINK REL="SHORTCUT ICON" HREF="http://www.music.mcgill.ca/~gary/favicon.ico">
6 </HEAD>
7 <BODY BGCOLOR="#FFFFFF">
8 <CENTER>
9 <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>
10 <HR>
11 <!-- Generated by Doxygen 1.4.4 -->
12 <div class="nav">
13 <a class="el" href="classRtAudio.html">RtAudio</a>::<a class="el" href="structRtAudio_1_1StreamOptions.html">StreamOptions</a></div>
14 <h1>RtAudio::StreamOptions Struct Reference</h1><!-- doxytag: class="RtAudio::StreamOptions" -->The structure for specifying stream options.  
15 <a href="#_details">More...</a>
16 <p>
17 <code>#include &lt;<a class="el" href="RtAudio_8h-source.html">RtAudio.h</a>&gt;</code>
18 <p>
19 <a href="structRtAudio_1_1StreamOptions-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
20 <tr><td></td></tr>
21 <tr><td colspan="2"><br><h2>Public Attributes</h2></td></tr>
22 <tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="RtAudio_8h.html#a8">RtAudioStreamFlags</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1StreamOptions.html#o0">flags</a></td></tr>
23
24 <tr><td class="memItemLeft" nowrap align="right" valign="top">unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1StreamOptions.html#o1">numberOfBuffers</a></td></tr>
25
26 <tr><td class="memItemLeft" nowrap align="right" valign="top">std::string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1StreamOptions.html#o2">streamName</a></td></tr>
27
28 </table>
29 <hr><a name="_details"></a><h2>Detailed Description</h2>
30 The structure for specifying stream options. 
31 <p>
32 The following flags can be OR'ed together to allow a client to make changes to the default stream behavior:<p>
33 <ul>
34 <li><em>RTAUDIO_NONINTERLEAVED:</em> Use non-interleaved buffers (default = interleaved).</li><li><em>RTAUDIO_MINIMIZE_LATENCY:</em> Attempt to set stream parameters for lowest possible latency.</li><li><em>RTAUDIO_HOG_DEVICE:</em> Attempt grab device for exclusive use.</li></ul>
35 <p>
36 By default, <a class="el" href="classRtAudio.html">RtAudio</a> streams pass and receive audio data from the client in an interleaved format. By passing the RTAUDIO_NONINTERLEAVED flag to the <a class="el" href="classRtAudio.html#a7">openStream()</a> function, audio data will instead be presented in non-interleaved buffers. In this case, each buffer argument in the RtAudioCallback function will point to a single array of data, with <code>nFrames</code> samples for each channel concatenated back-to-back. For example, the first sample of data for the second channel would be located at index <code>nFrames</code> (assuming the <code>buffer</code> pointer was recast to the correct data type for the stream).<p>
37 Certain audio APIs offer a number of parameters that influence the I/O latency of a stream. By default, <a class="el" href="classRtAudio.html">RtAudio</a> will attempt to set these parameters internally for robust (glitch-free) performance (though some APIs, like Windows Direct Sound, make this difficult). By passing the RTAUDIO_MINIMIZE_LATENCY flag to the <a class="el" href="classRtAudio.html#a7">openStream()</a> function, internal stream settings will be influenced in an attempt to minimize stream latency, though possibly at the expense of stream performance.<p>
38 If the RTAUDIO_HOG_DEVICE flag is set, <a class="el" href="classRtAudio.html">RtAudio</a> will attempt to open the input and/or output stream device(s) for exclusive use. Note that this is not possible with all supported audio APIs.<p>
39 The <code>numberOfBuffers</code> parameter can be used to control stream latency in the Windows DirectSound, Linux OSS, and Linux Alsa APIs only. A value of two is usually the smallest allowed. Larger numbers can potentially result in more robust stream performance, though likely at the cost of stream latency. The value set by the user is replaced during execution of the <a class="el" href="classRtAudio.html#a7">RtAudio::openStream()</a> function by the value actually used by the system.<p>
40 The <code>streamName</code> parameter can be used to set the client name when using the Jack API. By default, the client name is set to RtApiJack. However, if you wish to create multiple instances of <a class="el" href="classRtAudio.html">RtAudio</a> with Jack, each instance must have a unique client name.
41 <p>
42 <hr><h2>Member Data Documentation</h2>
43 <a class="anchor" name="o0"></a><!-- doxytag: member="RtAudio::StreamOptions::flags" ref="o0" args="" --><p>
44 <table class="mdTable" cellpadding="2" cellspacing="0">
45   <tr>
46     <td class="mdRow">
47       <table cellpadding="0" cellspacing="0" border="0">
48         <tr>
49           <td class="md" nowrap valign="top"><a class="el" href="RtAudio_8h.html#a8">RtAudioStreamFlags</a> <a class="el" href="structRtAudio_1_1StreamOptions.html#o0">RtAudio::StreamOptions::flags</a>          </td>
50         </tr>
51       </table>
52     </td>
53   </tr>
54 </table>
55 <table cellspacing="5" cellpadding="0" border="0">
56   <tr>
57     <td>
58       &nbsp;
59     </td>
60     <td>
61
62 <p>
63 A bit-mask of stream flags (RTAUDIO_NONINTERLEAVED, RTAUDIO_MINIMIZE_LATENCY, RTAUDIO_HOG_DEVICE).     </td>
64   </tr>
65 </table>
66 <a class="anchor" name="o1"></a><!-- doxytag: member="RtAudio::StreamOptions::numberOfBuffers" ref="o1" args="" --><p>
67 <table class="mdTable" cellpadding="2" cellspacing="0">
68   <tr>
69     <td class="mdRow">
70       <table cellpadding="0" cellspacing="0" border="0">
71         <tr>
72           <td class="md" nowrap valign="top">unsigned int <a class="el" href="structRtAudio_1_1StreamOptions.html#o1">RtAudio::StreamOptions::numberOfBuffers</a>          </td>
73         </tr>
74       </table>
75     </td>
76   </tr>
77 </table>
78 <table cellspacing="5" cellpadding="0" border="0">
79   <tr>
80     <td>
81       &nbsp;
82     </td>
83     <td>
84
85 <p>
86 Number of stream buffers.     </td>
87   </tr>
88 </table>
89 <a class="anchor" name="o2"></a><!-- doxytag: member="RtAudio::StreamOptions::streamName" ref="o2" args="" --><p>
90 <table class="mdTable" cellpadding="2" cellspacing="0">
91   <tr>
92     <td class="mdRow">
93       <table cellpadding="0" cellspacing="0" border="0">
94         <tr>
95           <td class="md" nowrap valign="top">std::string <a class="el" href="structRtAudio_1_1StreamOptions.html#o2">RtAudio::StreamOptions::streamName</a>          </td>
96         </tr>
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 A stream name (currently used only in Jack).     </td>
110   </tr>
111 </table>
112 <hr>The documentation for this struct was generated from the following file:<ul>
113 <li><a class="el" href="RtAudio_8h-source.html">RtAudio.h</a></ul>
114 <HR>
115
116 <table><tr><td><img src="../images/mcgill.gif" width=165></td>
117   <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>
118 </table>
119
120 </BODY>
121 </HTML>