Audio plugin host https://kx.studio/carla
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

structRtAudio_1_1StreamOptions.html 9.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  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. <p><code>#include &lt;<a class="el" href="RtAudio_8h_source.html">RtAudio.h</a>&gt;</code></p>
  19. <p><a href="structRtAudio_1_1StreamOptions-members.html">List of all members.</a></p>
  20. <table border="0" cellpadding="0" cellspacing="0">
  21. <tr><td colspan="2"><h2>Public Attributes</h2></td></tr>
  22. <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>
  23. <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>
  24. <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>
  25. <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>
  26. </table>
  27. <hr/><a name="_details"></a><h2>Detailed Description</h2>
  28. <p>The structure for specifying stream options. </p>
  29. <p>The following flags can be OR'ed together to allow a client to make changes to the default stream behavior:</p>
  30. <ul>
  31. <li><em>RTAUDIO_NONINTERLEAVED:</em> Use non-interleaved buffers (default = interleaved).</li>
  32. <li><em>RTAUDIO_MINIMIZE_LATENCY:</em> Attempt to set stream parameters for lowest possible latency.</li>
  33. <li><em>RTAUDIO_HOG_DEVICE:</em> Attempt grab device for exclusive use.</li>
  34. <li><em>RTAUDIO_SCHEDULE_REALTIME:</em> Attempt to select realtime scheduling for callback thread.</li>
  35. <li><em>RTAUDIO_ALSA_USE_DEFAULT:</em> Use the "default" PCM device (ALSA only).</li>
  36. </ul>
  37. <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>
  38. <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>
  39. <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>
  40. <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>
  41. <p>If the RTAUDIO_ALSA_USE_DEFAULT flag is set, <a class="el" href="classRtAudio.html" title="Realtime audio i/o C++ classes.">RtAudio</a> will attempt to open the "default" PCM device when using the ALSA API. Note that this will override any specified input or output device id.</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, RTAUDIO_ALSA_USE_DEFAULT). </p>
  56. </div>
  57. </div>
  58. <a class="anchor" id="a75a14cfab903d0e1c091bc16aec80240"></a><!-- doxytag: member="RtAudio::StreamOptions::numberOfBuffers" ref="a75a14cfab903d0e1c091bc16aec80240" args="" -->
  59. <div class="memitem">
  60. <div class="memproto">
  61. <table class="memname">
  62. <tr>
  63. <td class="memname">unsigned int <a class="el" href="structRtAudio_1_1StreamOptions.html#a75a14cfab903d0e1c091bc16aec80240">RtAudio::StreamOptions::numberOfBuffers</a></td>
  64. </tr>
  65. </table>
  66. </div>
  67. <div class="memdoc">
  68. <p>Number of stream buffers. </p>
  69. </div>
  70. </div>
  71. <a class="anchor" id="a2a4b0b8d690c624d20f4e8f4be6ca9ba"></a><!-- doxytag: member="RtAudio::StreamOptions::streamName" ref="a2a4b0b8d690c624d20f4e8f4be6ca9ba" args="" -->
  72. <div class="memitem">
  73. <div class="memproto">
  74. <table class="memname">
  75. <tr>
  76. <td class="memname">std::string <a class="el" href="structRtAudio_1_1StreamOptions.html#a2a4b0b8d690c624d20f4e8f4be6ca9ba">RtAudio::StreamOptions::streamName</a></td>
  77. </tr>
  78. </table>
  79. </div>
  80. <div class="memdoc">
  81. <p>A stream name (currently used only in Jack). </p>
  82. </div>
  83. </div>
  84. <a class="anchor" id="adfd267059434edb21573c584e6367def"></a><!-- doxytag: member="RtAudio::StreamOptions::priority" ref="adfd267059434edb21573c584e6367def" args="" -->
  85. <div class="memitem">
  86. <div class="memproto">
  87. <table class="memname">
  88. <tr>
  89. <td class="memname">int <a class="el" href="structRtAudio_1_1StreamOptions.html#adfd267059434edb21573c584e6367def">RtAudio::StreamOptions::priority</a></td>
  90. </tr>
  91. </table>
  92. </div>
  93. <div class="memdoc">
  94. <p>Scheduling priority of callback thread (only used with flag RTAUDIO_SCHEDULE_REALTIME). </p>
  95. </div>
  96. </div>
  97. <hr/>The documentation for this struct was generated from the following file:<ul>
  98. <li><a class="el" href="RtAudio_8h_source.html">RtAudio.h</a></li>
  99. </ul>
  100. </div>
  101. <HR>
  102. <table><tr><td><img src="../images/mcgill.gif" width=165></td>
  103. <td>&copy;2001-2012 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>
  104. </table>
  105. </BODY>
  106. </HTML>