Release 4.0.7 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.6.2 -->
12   <div class="navpath"><a class="el" href="classRtAudio.html">RtAudio</a>::<a class="el" href="structRtAudio_1_1StreamOptions.html">StreamOptions</a>
13   </div>
14 <div class="contents">
15 <h1>RtAudio::StreamOptions Struct Reference</h1><!-- doxytag: class="RtAudio::StreamOptions" -->
16 <p>The structure for specifying stream options.  
17 <a href="#_details">More...</a></p>
18
19 <p><code>#include &lt;<a class="el" href="RtAudio_8h_source.html">RtAudio.h</a>&gt;</code></p>
20
21 <p><a href="structRtAudio_1_1StreamOptions-members.html">List of all members.</a></p>
22 <table border="0" cellpadding="0" cellspacing="0">
23 <tr><td colspan="2"><h2>Public Attributes</h2></td></tr>
24 <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="RtAudio_8h.html#a2c0f59b200dcec4d4e760f9166b29c41">RtAudioStreamFlags</a>&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1StreamOptions.html#a0ecc98b031aa3af49d09b781643e298b">flags</a></td></tr>
25 <tr><td class="memItemLeft" align="right" valign="top">unsigned int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1StreamOptions.html#a75a14cfab903d0e1c091bc16aec80240">numberOfBuffers</a></td></tr>
26 <tr><td class="memItemLeft" align="right" valign="top">std::string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1StreamOptions.html#a2a4b0b8d690c624d20f4e8f4be6ca9ba">streamName</a></td></tr>
27 <tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structRtAudio_1_1StreamOptions.html#adfd267059434edb21573c584e6367def">priority</a></td></tr>
28 </table>
29 <hr/><a name="_details"></a><h2>Detailed Description</h2>
30 <p>The structure for specifying stream options. </p>
31 <p>The following flags can be OR'ed together to allow a client to make changes to the default stream behavior:</p>
32 <ul>
33 <li><em>RTAUDIO_NONINTERLEAVED:</em> Use non-interleaved buffers (default = interleaved).</li>
34 <li><em>RTAUDIO_MINIMIZE_LATENCY:</em> Attempt to set stream parameters for lowest possible latency.</li>
35 <li><em>RTAUDIO_HOG_DEVICE:</em> Attempt grab device for exclusive use.</li>
36 <li><em>RTAUDIO_SCHEDULE_REALTIME:</em> Attempt to select realtime scheduling for callback thread.</li>
37 </ul>
38 <p>By default, <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">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#afacc99740fa4c5606fb35467cdea6da8" title="A public function for opening a stream with the specified parameters.">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>
39 <p>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" title="Realtime audio i/o C++ classes.">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#afacc99740fa4c5606fb35467cdea6da8" title="A public function for opening a stream with the specified parameters.">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>
40 <p>If the RTAUDIO_HOG_DEVICE flag is set, <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">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>
41 <p>If the RTAUDIO_SCHEDULE_REALTIME flag is set, <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> will attempt to select realtime scheduling (round-robin) for the callback thread. The <code>priority</code> parameter will only be used if the RTAUDIO_SCHEDULE_REALTIME flag is set. It defines the thread's realtime priority.</p>
42 <p>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#afacc99740fa4c5606fb35467cdea6da8" title="A public function for opening a stream with the specified parameters.">RtAudio::openStream()</a> function by the value actually used by the system.</p>
43 <p>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" title="Realtime audio i/o C++ classes.">RtAudio</a> with Jack, each instance must have a unique client name. </p>
44 <hr/><h2>Member Data Documentation</h2>
45 <a class="anchor" id="a0ecc98b031aa3af49d09b781643e298b"></a><!-- doxytag: member="RtAudio::StreamOptions::flags" ref="a0ecc98b031aa3af49d09b781643e298b" args="" -->
46 <div class="memitem">
47 <div class="memproto">
48       <table class="memname">
49         <tr>
50           <td class="memname"><a class="el" href="RtAudio_8h.html#a2c0f59b200dcec4d4e760f9166b29c41">RtAudioStreamFlags</a> <a class="el" href="structRtAudio_1_1StreamOptions.html#a0ecc98b031aa3af49d09b781643e298b">RtAudio::StreamOptions::flags</a></td>
51         </tr>
52       </table>
53 </div>
54 <div class="memdoc">
55 <p>A bit-mask of stream flags (RTAUDIO_NONINTERLEAVED, RTAUDIO_MINIMIZE_LATENCY, RTAUDIO_HOG_DEVICE). </p>
56
57 </div>
58 </div>
59 <a class="anchor" id="a75a14cfab903d0e1c091bc16aec80240"></a><!-- doxytag: member="RtAudio::StreamOptions::numberOfBuffers" ref="a75a14cfab903d0e1c091bc16aec80240" args="" -->
60 <div class="memitem">
61 <div class="memproto">
62       <table class="memname">
63         <tr>
64           <td class="memname">unsigned int <a class="el" href="structRtAudio_1_1StreamOptions.html#a75a14cfab903d0e1c091bc16aec80240">RtAudio::StreamOptions::numberOfBuffers</a></td>
65         </tr>
66       </table>
67 </div>
68 <div class="memdoc">
69 <p>Number of stream buffers. </p>
70
71 </div>
72 </div>
73 <a class="anchor" id="a2a4b0b8d690c624d20f4e8f4be6ca9ba"></a><!-- doxytag: member="RtAudio::StreamOptions::streamName" ref="a2a4b0b8d690c624d20f4e8f4be6ca9ba" args="" -->
74 <div class="memitem">
75 <div class="memproto">
76       <table class="memname">
77         <tr>
78           <td class="memname">std::string <a class="el" href="structRtAudio_1_1StreamOptions.html#a2a4b0b8d690c624d20f4e8f4be6ca9ba">RtAudio::StreamOptions::streamName</a></td>
79         </tr>
80       </table>
81 </div>
82 <div class="memdoc">
83 <p>A stream name (currently used only in Jack). </p>
84
85 </div>
86 </div>
87 <a class="anchor" id="adfd267059434edb21573c584e6367def"></a><!-- doxytag: member="RtAudio::StreamOptions::priority" ref="adfd267059434edb21573c584e6367def" args="" -->
88 <div class="memitem">
89 <div class="memproto">
90       <table class="memname">
91         <tr>
92           <td class="memname">int <a class="el" href="structRtAudio_1_1StreamOptions.html#adfd267059434edb21573c584e6367def">RtAudio::StreamOptions::priority</a></td>
93         </tr>
94       </table>
95 </div>
96 <div class="memdoc">
97 <p>Scheduling priority of callback thread (only used with flag RTAUDIO_SCHEDULE_REALTIME). </p>
98
99 </div>
100 </div>
101 <hr/>The documentation for this struct was generated from the following file:<ul>
102 <li><a class="el" href="RtAudio_8h_source.html">RtAudio.h</a></li>
103 </ul>
104 </div>
105 <HR>
106
107 <table><tr><td><img src="../images/mcgill.gif" width=165></td>
108   <td>&copy;2001-2010 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>
109 </table>
110
111 </BODY>
112 </HTML>