1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xmlns="http://www.w3.org/1999/xhtml"> 3<head> 4<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> 5<meta http-equiv="X-UA-Compatible" content="IE=9"/> 6<meta name="generator" content="Doxygen 1.8.15"/> 7<meta name="viewport" content="width=device-width, initial-scale=1"/> 8<title>Oboe: oboe::DefaultStreamValues Class Reference</title> 9<link href="tabs.css" rel="stylesheet" type="text/css"/> 10<script type="text/javascript" src="jquery.js"></script> 11<script type="text/javascript" src="dynsections.js"></script> 12<link href="search/search.css" rel="stylesheet" type="text/css"/> 13<script type="text/javascript" src="search/searchdata.js"></script> 14<script type="text/javascript" src="search/search.js"></script> 15<link href="doxygen.css" rel="stylesheet" type="text/css" /> 16</head> 17<body> 18<div id="top"><!-- do not remove this div, it is closed by doxygen! --> 19<div id="titlearea"> 20<table cellspacing="0" cellpadding="0"> 21 <tbody> 22 <tr style="height: 56px;"> 23 <td id="projectalign" style="padding-left: 0.5em;"> 24 <div id="projectname">Oboe 25  <span id="projectnumber">1.5</span> 26 </div> 27 <div id="projectbrief">A library for creating real-time audio apps on Android</div> 28 </td> 29 </tr> 30 </tbody> 31</table> 32</div> 33<!-- end header part --> 34<!-- Generated by Doxygen 1.8.15 --> 35<script type="text/javascript"> 36/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ 37var searchBox = new SearchBox("searchBox", "search",false,'Search'); 38/* @license-end */ 39</script> 40<script type="text/javascript" src="menudata.js"></script> 41<script type="text/javascript" src="menu.js"></script> 42<script type="text/javascript"> 43/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ 44$(function() { 45 initMenu('',true,false,'search.php','Search'); 46 $(document).ready(function() { init_search(); }); 47}); 48/* @license-end */</script> 49<div id="main-nav"></div> 50<!-- window showing the filter options --> 51<div id="MSearchSelectWindow" 52 onmouseover="return searchBox.OnSearchSelectShow()" 53 onmouseout="return searchBox.OnSearchSelectHide()" 54 onkeydown="return searchBox.OnSearchSelectKey(event)"> 55</div> 56 57<!-- iframe showing the search results (closed by default) --> 58<div id="MSearchResultsWindow"> 59<iframe src="javascript:void(0)" frameborder="0" 60 name="MSearchResults" id="MSearchResults"> 61</iframe> 62</div> 63 64<div id="nav-path" class="navpath"> 65 <ul> 66<li class="navelem"><a class="el" href="namespaceoboe.html">oboe</a></li><li class="navelem"><a class="el" href="classoboe_1_1_default_stream_values.html">DefaultStreamValues</a></li> </ul> 67</div> 68</div><!-- top --> 69<div class="header"> 70 <div class="summary"> 71<a href="#pub-static-attribs">Static Public Attributes</a> | 72<a href="classoboe_1_1_default_stream_values-members.html">List of all members</a> </div> 73 <div class="headertitle"> 74<div class="title">oboe::DefaultStreamValues Class Reference</div> </div> 75</div><!--header--> 76<div class="contents"> 77 78<p><code>#include <<a class="el" href="_definitions_8h_source.html">Definitions.h</a>></code></p> 79<table class="memberdecls"> 80<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a> 81Static Public Attributes</h2></td></tr> 82<tr class="memitem:a46a5d9a653f2153f618cadcab764e1b1"><td class="memItemLeft" align="right" valign="top">static int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classoboe_1_1_default_stream_values.html#a46a5d9a653f2153f618cadcab764e1b1">SampleRate</a></td></tr> 83<tr class="separator:a46a5d9a653f2153f618cadcab764e1b1"><td class="memSeparator" colspan="2"> </td></tr> 84<tr class="memitem:ab5ea5576699cebc56193f5c297d3e300"><td class="memItemLeft" align="right" valign="top">static int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classoboe_1_1_default_stream_values.html#ab5ea5576699cebc56193f5c297d3e300">FramesPerBurst</a></td></tr> 85<tr class="separator:ab5ea5576699cebc56193f5c297d3e300"><td class="memSeparator" colspan="2"> </td></tr> 86<tr class="memitem:ad5dce538d5963c81bf58350ab730962d"><td class="memItemLeft" align="right" valign="top">static int32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="classoboe_1_1_default_stream_values.html#ad5dce538d5963c81bf58350ab730962d">ChannelCount</a></td></tr> 87<tr class="separator:ad5dce538d5963c81bf58350ab730962d"><td class="memSeparator" colspan="2"> </td></tr> 88</table> 89<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> 90<div class="textblock"><p>On API 16 to 26 OpenSL ES will be used. When using OpenSL ES the optimal values for sampleRate and framesPerBurst are not known by the native code. On API 17+ these values should be obtained from the AudioManager using this code:</p> 91<pre><code> 92// Note that this technique only works for built-in speakers and headphones. 93AudioManager myAudioMgr = (AudioManager) getSystemService(Context.AUDIO_SERVICE); 94String sampleRateStr = myAudioMgr.getProperty(AudioManager.PROPERTY_OUTPUT_SAMPLE_RATE); 95int defaultSampleRate = Integer.parseInt(sampleRateStr); 96String framesPerBurstStr = myAudioMgr.getProperty(AudioManager.PROPERTY_OUTPUT_FRAMES_PER_BUFFER); 97int defaultFramesPerBurst = Integer.parseInt(framesPerBurstStr); 98</code></pre><p>It can then be passed down to Oboe through JNI.</p> 99<p>AAudio will get the optimal framesPerBurst from the HAL and will ignore this value. </p> 100</div><h2 class="groupheader">Member Data Documentation</h2> 101<a id="ad5dce538d5963c81bf58350ab730962d"></a> 102<h2 class="memtitle"><span class="permalink"><a href="#ad5dce538d5963c81bf58350ab730962d">◆ </a></span>ChannelCount</h2> 103 104<div class="memitem"> 105<div class="memproto"> 106<table class="mlabels"> 107 <tr> 108 <td class="mlabels-left"> 109 <table class="memname"> 110 <tr> 111 <td class="memname">int32_t oboe::DefaultStreamValues::ChannelCount</td> 112 </tr> 113 </table> 114 </td> 115 <td class="mlabels-right"> 116<span class="mlabels"><span class="mlabel">static</span></span> </td> 117 </tr> 118</table> 119</div><div class="memdoc"> 120<p>The default channel count to use when opening new audio streams </p> 121 122</div> 123</div> 124<a id="ab5ea5576699cebc56193f5c297d3e300"></a> 125<h2 class="memtitle"><span class="permalink"><a href="#ab5ea5576699cebc56193f5c297d3e300">◆ </a></span>FramesPerBurst</h2> 126 127<div class="memitem"> 128<div class="memproto"> 129<table class="mlabels"> 130 <tr> 131 <td class="mlabels-left"> 132 <table class="memname"> 133 <tr> 134 <td class="memname">int32_t oboe::DefaultStreamValues::FramesPerBurst</td> 135 </tr> 136 </table> 137 </td> 138 <td class="mlabels-right"> 139<span class="mlabels"><span class="mlabel">static</span></span> </td> 140 </tr> 141</table> 142</div><div class="memdoc"> 143<p>The default frames per burst to use when opening new audio streams </p> 144 145</div> 146</div> 147<a id="a46a5d9a653f2153f618cadcab764e1b1"></a> 148<h2 class="memtitle"><span class="permalink"><a href="#a46a5d9a653f2153f618cadcab764e1b1">◆ </a></span>SampleRate</h2> 149 150<div class="memitem"> 151<div class="memproto"> 152<table class="mlabels"> 153 <tr> 154 <td class="mlabels-left"> 155 <table class="memname"> 156 <tr> 157 <td class="memname">int32_t oboe::DefaultStreamValues::SampleRate</td> 158 </tr> 159 </table> 160 </td> 161 <td class="mlabels-right"> 162<span class="mlabels"><span class="mlabel">static</span></span> </td> 163 </tr> 164</table> 165</div><div class="memdoc"> 166<p>The default sample rate to use when opening new audio streams </p> 167 168</div> 169</div> 170<hr/>The documentation for this class was generated from the following file:<ul> 171<li>include/oboe/<a class="el" href="_definitions_8h_source.html">Definitions.h</a></li> 172</ul> 173</div><!-- contents --> 174<!-- start footer part --> 175<hr class="footer"/><address class="footer"><small> 176Generated by  <a href="http://www.doxygen.org/index.html"> 177<img class="footer" src="doxygen.png" alt="doxygen"/> 178</a> 1.8.15 179</small></address> 180</body> 181</html> 182