1# 音频管理<a name="ZH-CN_TOPIC_0000001164135644"></a> 2 3## 导入模块<a name="zh-cn_topic_0000001149807881_s56d19203690d4782bfc74069abb6bd71"></a> 4 5``` 6import audio from '@ohos.multimedia.audio'; 7``` 8 9## 权限<a name="zh-cn_topic_0000001149807881_section11257113618419"></a> 10 11无 12 13## getAudioManager\(\): AudioManager<a name="zh-cn_topic_0000001149807881_section84581011418"></a> 14 15获取音频管理器。 16 17**返回值:** 18 19<a name="zh-cn_topic_0000001149807881_table16391145317913"></a> 20<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row2391145319910"><th class="cellrowborder" valign="top" width="17.01%" id="mcps1.1.3.1.1"><p id="zh-cn_topic_0000001149807881_p13911353991"><a name="zh-cn_topic_0000001149807881_p13911353991"></a><a name="zh-cn_topic_0000001149807881_p13911353991"></a>类型</p> 21</th> 22<th class="cellrowborder" valign="top" width="82.99%" id="mcps1.1.3.1.2"><p id="zh-cn_topic_0000001149807881_p193911531395"><a name="zh-cn_topic_0000001149807881_p193911531395"></a><a name="zh-cn_topic_0000001149807881_p193911531395"></a>说明</p> 23</th> 24</tr> 25</thead> 26<tbody><tr id="zh-cn_topic_0000001149807881_row1339114531391"><td class="cellrowborder" valign="top" width="17.01%" headers="mcps1.1.3.1.1 "><p id="zh-cn_topic_0000001149807881_p1338931454713"><a name="zh-cn_topic_0000001149807881_p1338931454713"></a><a name="zh-cn_topic_0000001149807881_p1338931454713"></a><a href="#zh-cn_topic_0000001149807881_section8265143814015">AudioManager</a></p> 27</td> 28<td class="cellrowborder" valign="top" width="82.99%" headers="mcps1.1.3.1.2 "><p id="zh-cn_topic_0000001149807881_p1039217531898"><a name="zh-cn_topic_0000001149807881_p1039217531898"></a><a name="zh-cn_topic_0000001149807881_p1039217531898"></a>音频管理类。</p> 29</td> 30</tr> 31</tbody> 32</table> 33 34**示例:** 35 36``` 37var audioManager = audio.getAudioManager(); 38``` 39 40## AudioVolumeType<a name="zh-cn_topic_0000001149807881_section92261857172218"></a> 41 42枚举,音频流类型。 43 44<a name="zh-cn_topic_0000001149807881_table689215633911"></a> 45<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row19892165613399"><th class="cellrowborder" valign="top" width="30.380000000000003%" id="mcps1.1.4.1.1"><p id="zh-cn_topic_0000001149807881_p148924564394"><a name="zh-cn_topic_0000001149807881_p148924564394"></a><a name="zh-cn_topic_0000001149807881_p148924564394"></a>名称</p> 46</th> 47<th class="cellrowborder" valign="top" width="9.950000000000001%" id="mcps1.1.4.1.2"><p id="zh-cn_topic_0000001149807881_aace9cae4ba0d4939bfa048460f61c3c7"><a name="zh-cn_topic_0000001149807881_aace9cae4ba0d4939bfa048460f61c3c7"></a><a name="zh-cn_topic_0000001149807881_aace9cae4ba0d4939bfa048460f61c3c7"></a>默认值</p> 48</th> 49<th class="cellrowborder" valign="top" width="59.67%" id="mcps1.1.4.1.3"><p id="zh-cn_topic_0000001149807881_p19892145616392"><a name="zh-cn_topic_0000001149807881_p19892145616392"></a><a name="zh-cn_topic_0000001149807881_p19892145616392"></a>描述</p> 50</th> 51</tr> 52</thead> 53<tbody><tr id="zh-cn_topic_0000001149807881_row1389215612395"><td class="cellrowborder" valign="top" width="30.380000000000003%" headers="mcps1.1.4.1.1 "><p id="zh-cn_topic_0000001149807881_p52851329122117"><a name="zh-cn_topic_0000001149807881_p52851329122117"></a><a name="zh-cn_topic_0000001149807881_p52851329122117"></a>RINGTONE</p> 54</td> 55<td class="cellrowborder" valign="top" width="9.950000000000001%" headers="mcps1.1.4.1.2 "><p id="zh-cn_topic_0000001149807881_p2282152962115"><a name="zh-cn_topic_0000001149807881_p2282152962115"></a><a name="zh-cn_topic_0000001149807881_p2282152962115"></a>2</p> 56</td> 57<td class="cellrowborder" valign="top" width="59.67%" headers="mcps1.1.4.1.3 "><p id="zh-cn_topic_0000001149807881_p328012293211"><a name="zh-cn_topic_0000001149807881_p328012293211"></a><a name="zh-cn_topic_0000001149807881_p328012293211"></a>表示铃声。</p> 58</td> 59</tr> 60<tr id="zh-cn_topic_0000001149807881_row6892145616397"><td class="cellrowborder" valign="top" width="30.380000000000003%" headers="mcps1.1.4.1.1 "><p id="zh-cn_topic_0000001149807881_p027662952110"><a name="zh-cn_topic_0000001149807881_p027662952110"></a><a name="zh-cn_topic_0000001149807881_p027662952110"></a>MEDIA</p> 61</td> 62<td class="cellrowborder" valign="top" width="9.950000000000001%" headers="mcps1.1.4.1.2 "><p id="zh-cn_topic_0000001149807881_p17273229192113"><a name="zh-cn_topic_0000001149807881_p17273229192113"></a><a name="zh-cn_topic_0000001149807881_p17273229192113"></a>3</p> 63</td> 64<td class="cellrowborder" valign="top" width="59.67%" headers="mcps1.1.4.1.3 "><p id="zh-cn_topic_0000001149807881_p182452299212"><a name="zh-cn_topic_0000001149807881_p182452299212"></a><a name="zh-cn_topic_0000001149807881_p182452299212"></a>表示媒体。</p> 65</td> 66</tr> 67</tbody> 68</table> 69 70## DeviceFlag<a name="zh-cn_topic_0000001149807881_section11285183164210"></a> 71 72枚举,可获取的设备种类。 73 74<a name="zh-cn_topic_0000001149807881_table162856320422"></a> 75<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row928593124213"><th class="cellrowborder" valign="top" width="30.380000000000003%" id="mcps1.1.4.1.1"><p id="zh-cn_topic_0000001149807881_p628553124216"><a name="zh-cn_topic_0000001149807881_p628553124216"></a><a name="zh-cn_topic_0000001149807881_p628553124216"></a>名称</p> 76</th> 77<th class="cellrowborder" valign="top" width="9.950000000000001%" id="mcps1.1.4.1.2"><p id="zh-cn_topic_0000001149807881_p1828512314213"><a name="zh-cn_topic_0000001149807881_p1828512314213"></a><a name="zh-cn_topic_0000001149807881_p1828512314213"></a>默认值</p> 78</th> 79<th class="cellrowborder" valign="top" width="59.67%" id="mcps1.1.4.1.3"><p id="zh-cn_topic_0000001149807881_p1228612334216"><a name="zh-cn_topic_0000001149807881_p1228612334216"></a><a name="zh-cn_topic_0000001149807881_p1228612334216"></a>描述</p> 80</th> 81</tr> 82</thead> 83<tbody><tr id="zh-cn_topic_0000001149807881_row2286435427"><td class="cellrowborder" valign="top" width="30.380000000000003%" headers="mcps1.1.4.1.1 "><p id="zh-cn_topic_0000001149807881_p19184101242511"><a name="zh-cn_topic_0000001149807881_p19184101242511"></a><a name="zh-cn_topic_0000001149807881_p19184101242511"></a>OUTPUT_DEVICES_FLAG</p> 84</td> 85<td class="cellrowborder" valign="top" width="9.950000000000001%" headers="mcps1.1.4.1.2 "><p id="zh-cn_topic_0000001149807881_p172861314213"><a name="zh-cn_topic_0000001149807881_p172861314213"></a><a name="zh-cn_topic_0000001149807881_p172861314213"></a>1</p> 86</td> 87<td class="cellrowborder" valign="top" width="59.67%" headers="mcps1.1.4.1.3 "><p id="zh-cn_topic_0000001149807881_p5286133134212"><a name="zh-cn_topic_0000001149807881_p5286133134212"></a><a name="zh-cn_topic_0000001149807881_p5286133134212"></a>表示输出设备种类。</p> 88</td> 89</tr> 90<tr id="zh-cn_topic_0000001149807881_row2286163194220"><td class="cellrowborder" valign="top" width="30.380000000000003%" headers="mcps1.1.4.1.1 "><p id="zh-cn_topic_0000001149807881_p5514162412251"><a name="zh-cn_topic_0000001149807881_p5514162412251"></a><a name="zh-cn_topic_0000001149807881_p5514162412251"></a>INPUT_DEVICES_FLAG</p> 91</td> 92<td class="cellrowborder" valign="top" width="9.950000000000001%" headers="mcps1.1.4.1.2 "><p id="zh-cn_topic_0000001149807881_p112863354219"><a name="zh-cn_topic_0000001149807881_p112863354219"></a><a name="zh-cn_topic_0000001149807881_p112863354219"></a>2</p> 93</td> 94<td class="cellrowborder" valign="top" width="59.67%" headers="mcps1.1.4.1.3 "><p id="zh-cn_topic_0000001149807881_p1328617334214"><a name="zh-cn_topic_0000001149807881_p1328617334214"></a><a name="zh-cn_topic_0000001149807881_p1328617334214"></a>表示输入设备种类。</p> 95</td> 96</tr> 97<tr id="zh-cn_topic_0000001149807881_row10631228192520"><td class="cellrowborder" valign="top" width="30.380000000000003%" headers="mcps1.1.4.1.1 "><p id="zh-cn_topic_0000001149807881_p1731716317259"><a name="zh-cn_topic_0000001149807881_p1731716317259"></a><a name="zh-cn_topic_0000001149807881_p1731716317259"></a>ALL_DEVICES_FLAG</p> 98</td> 99<td class="cellrowborder" valign="top" width="9.950000000000001%" headers="mcps1.1.4.1.2 "><p id="zh-cn_topic_0000001149807881_p1364628102517"><a name="zh-cn_topic_0000001149807881_p1364628102517"></a><a name="zh-cn_topic_0000001149807881_p1364628102517"></a>3</p> 100</td> 101<td class="cellrowborder" valign="top" width="59.67%" headers="mcps1.1.4.1.3 "><p id="zh-cn_topic_0000001149807881_p1864182814256"><a name="zh-cn_topic_0000001149807881_p1864182814256"></a><a name="zh-cn_topic_0000001149807881_p1864182814256"></a>表示所有设备种类。</p> 102</td> 103</tr> 104</tbody> 105</table> 106 107## DeviceRole<a name="zh-cn_topic_0000001149807881_section380038142619"></a> 108 109枚举,设备角色。 110 111<a name="zh-cn_topic_0000001149807881_table48001786268"></a> 112<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row138007814267"><th class="cellrowborder" valign="top" width="30.380000000000003%" id="mcps1.1.4.1.1"><p id="zh-cn_topic_0000001149807881_p1980068112616"><a name="zh-cn_topic_0000001149807881_p1980068112616"></a><a name="zh-cn_topic_0000001149807881_p1980068112616"></a>名称</p> 113</th> 114<th class="cellrowborder" valign="top" width="9.950000000000001%" id="mcps1.1.4.1.2"><p id="zh-cn_topic_0000001149807881_p28003819263"><a name="zh-cn_topic_0000001149807881_p28003819263"></a><a name="zh-cn_topic_0000001149807881_p28003819263"></a>默认值</p> 115</th> 116<th class="cellrowborder" valign="top" width="59.67%" id="mcps1.1.4.1.3"><p id="zh-cn_topic_0000001149807881_p3800118112615"><a name="zh-cn_topic_0000001149807881_p3800118112615"></a><a name="zh-cn_topic_0000001149807881_p3800118112615"></a>描述</p> 117</th> 118</tr> 119</thead> 120<tbody><tr id="zh-cn_topic_0000001149807881_row98008816264"><td class="cellrowborder" valign="top" width="30.380000000000003%" headers="mcps1.1.4.1.1 "><p id="zh-cn_topic_0000001149807881_p1542334211265"><a name="zh-cn_topic_0000001149807881_p1542334211265"></a><a name="zh-cn_topic_0000001149807881_p1542334211265"></a>INPUT_DEVICE</p> 121</td> 122<td class="cellrowborder" valign="top" width="9.950000000000001%" headers="mcps1.1.4.1.2 "><p id="zh-cn_topic_0000001149807881_p98008852610"><a name="zh-cn_topic_0000001149807881_p98008852610"></a><a name="zh-cn_topic_0000001149807881_p98008852610"></a>1</p> 123</td> 124<td class="cellrowborder" valign="top" width="59.67%" headers="mcps1.1.4.1.3 "><p id="zh-cn_topic_0000001149807881_p118009817260"><a name="zh-cn_topic_0000001149807881_p118009817260"></a><a name="zh-cn_topic_0000001149807881_p118009817260"></a>输入设备角色。</p> 125</td> 126</tr> 127<tr id="zh-cn_topic_0000001149807881_row680018802618"><td class="cellrowborder" valign="top" width="30.380000000000003%" headers="mcps1.1.4.1.1 "><p id="zh-cn_topic_0000001149807881_p2011710479267"><a name="zh-cn_topic_0000001149807881_p2011710479267"></a><a name="zh-cn_topic_0000001149807881_p2011710479267"></a>OUTPUT_DEVICE</p> 128</td> 129<td class="cellrowborder" valign="top" width="9.950000000000001%" headers="mcps1.1.4.1.2 "><p id="zh-cn_topic_0000001149807881_p08009812613"><a name="zh-cn_topic_0000001149807881_p08009812613"></a><a name="zh-cn_topic_0000001149807881_p08009812613"></a>2</p> 130</td> 131<td class="cellrowborder" valign="top" width="59.67%" headers="mcps1.1.4.1.3 "><p id="zh-cn_topic_0000001149807881_p380020842611"><a name="zh-cn_topic_0000001149807881_p380020842611"></a><a name="zh-cn_topic_0000001149807881_p380020842611"></a>输出设备角色。</p> 132</td> 133</tr> 134</tbody> 135</table> 136 137## DeviceType<a name="zh-cn_topic_0000001149807881_section11727420122710"></a> 138 139枚举,设备类型。 140 141<a name="zh-cn_topic_0000001149807881_table67271020132718"></a> 142<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row4727122012711"><th class="cellrowborder" valign="top" width="30.380000000000003%" id="mcps1.1.4.1.1"><p id="zh-cn_topic_0000001149807881_p157271520152715"><a name="zh-cn_topic_0000001149807881_p157271520152715"></a><a name="zh-cn_topic_0000001149807881_p157271520152715"></a>名称</p> 143</th> 144<th class="cellrowborder" valign="top" width="9.950000000000001%" id="mcps1.1.4.1.2"><p id="zh-cn_topic_0000001149807881_p187271620152719"><a name="zh-cn_topic_0000001149807881_p187271620152719"></a><a name="zh-cn_topic_0000001149807881_p187271620152719"></a>默认值</p> 145</th> 146<th class="cellrowborder" valign="top" width="59.67%" id="mcps1.1.4.1.3"><p id="zh-cn_topic_0000001149807881_p772720201277"><a name="zh-cn_topic_0000001149807881_p772720201277"></a><a name="zh-cn_topic_0000001149807881_p772720201277"></a>描述</p> 147</th> 148</tr> 149</thead> 150<tbody><tr id="zh-cn_topic_0000001149807881_row572714205272"><td class="cellrowborder" valign="top" width="30.380000000000003%" headers="mcps1.1.4.1.1 "><p id="zh-cn_topic_0000001149807881_p1895057192713"><a name="zh-cn_topic_0000001149807881_p1895057192713"></a><a name="zh-cn_topic_0000001149807881_p1895057192713"></a>INVALID</p> 151</td> 152<td class="cellrowborder" valign="top" width="9.950000000000001%" headers="mcps1.1.4.1.2 "><p id="zh-cn_topic_0000001149807881_p772892012273"><a name="zh-cn_topic_0000001149807881_p772892012273"></a><a name="zh-cn_topic_0000001149807881_p772892012273"></a>0</p> 153</td> 154<td class="cellrowborder" valign="top" width="59.67%" headers="mcps1.1.4.1.3 "><p id="zh-cn_topic_0000001149807881_p137281920172712"><a name="zh-cn_topic_0000001149807881_p137281920172712"></a><a name="zh-cn_topic_0000001149807881_p137281920172712"></a>无效设备。</p> 155</td> 156</tr> 157<tr id="zh-cn_topic_0000001149807881_row16728520192714"><td class="cellrowborder" valign="top" width="30.380000000000003%" headers="mcps1.1.4.1.1 "><p id="zh-cn_topic_0000001149807881_p4753161132815"><a name="zh-cn_topic_0000001149807881_p4753161132815"></a><a name="zh-cn_topic_0000001149807881_p4753161132815"></a>SPEAKER</p> 158</td> 159<td class="cellrowborder" valign="top" width="9.950000000000001%" headers="mcps1.1.4.1.2 "><p id="zh-cn_topic_0000001149807881_p3728920162713"><a name="zh-cn_topic_0000001149807881_p3728920162713"></a><a name="zh-cn_topic_0000001149807881_p3728920162713"></a>1</p> 160</td> 161<td class="cellrowborder" valign="top" width="59.67%" headers="mcps1.1.4.1.3 "><p id="zh-cn_topic_0000001149807881_p17728112062715"><a name="zh-cn_topic_0000001149807881_p17728112062715"></a><a name="zh-cn_topic_0000001149807881_p17728112062715"></a>扬声器。</p> 162</td> 163</tr> 164<tr id="zh-cn_topic_0000001149807881_row1758117472814"><td class="cellrowborder" valign="top" width="30.380000000000003%" headers="mcps1.1.4.1.1 "><p id="zh-cn_topic_0000001149807881_p74802011112815"><a name="zh-cn_topic_0000001149807881_p74802011112815"></a><a name="zh-cn_topic_0000001149807881_p74802011112815"></a>WIRED_HEADSET</p> 165</td> 166<td class="cellrowborder" valign="top" width="9.950000000000001%" headers="mcps1.1.4.1.2 "><p id="zh-cn_topic_0000001149807881_p35820462819"><a name="zh-cn_topic_0000001149807881_p35820462819"></a><a name="zh-cn_topic_0000001149807881_p35820462819"></a>2</p> 167</td> 168<td class="cellrowborder" valign="top" width="59.67%" headers="mcps1.1.4.1.3 "><p id="zh-cn_topic_0000001149807881_p155821548285"><a name="zh-cn_topic_0000001149807881_p155821548285"></a><a name="zh-cn_topic_0000001149807881_p155821548285"></a>有线耳机。</p> 169</td> 170</tr> 171<tr id="zh-cn_topic_0000001149807881_row1335108192818"><td class="cellrowborder" valign="top" width="30.380000000000003%" headers="mcps1.1.4.1.1 "><p id="zh-cn_topic_0000001149807881_p107521514142811"><a name="zh-cn_topic_0000001149807881_p107521514142811"></a><a name="zh-cn_topic_0000001149807881_p107521514142811"></a>BLUETOOTH_SCO</p> 172</td> 173<td class="cellrowborder" valign="top" width="9.950000000000001%" headers="mcps1.1.4.1.2 "><p id="zh-cn_topic_0000001149807881_p18335108112819"><a name="zh-cn_topic_0000001149807881_p18335108112819"></a><a name="zh-cn_topic_0000001149807881_p18335108112819"></a>3</p> 174</td> 175<td class="cellrowborder" valign="top" width="59.67%" headers="mcps1.1.4.1.3 "><p id="zh-cn_topic_0000001149807881_p193351683289"><a name="zh-cn_topic_0000001149807881_p193351683289"></a><a name="zh-cn_topic_0000001149807881_p193351683289"></a>SCO(Synchronous Connection Oriented Link)蓝牙设备。</p> 176</td> 177</tr> 178<tr id="zh-cn_topic_0000001149807881_row1649111617286"><td class="cellrowborder" valign="top" width="30.380000000000003%" headers="mcps1.1.4.1.1 "><p id="zh-cn_topic_0000001149807881_p10784017102818"><a name="zh-cn_topic_0000001149807881_p10784017102818"></a><a name="zh-cn_topic_0000001149807881_p10784017102818"></a>BLUETOOTH_A2DP</p> 179</td> 180<td class="cellrowborder" valign="top" width="9.950000000000001%" headers="mcps1.1.4.1.2 "><p id="zh-cn_topic_0000001149807881_p849110610286"><a name="zh-cn_topic_0000001149807881_p849110610286"></a><a name="zh-cn_topic_0000001149807881_p849110610286"></a>4</p> 181</td> 182<td class="cellrowborder" valign="top" width="59.67%" headers="mcps1.1.4.1.3 "><p id="zh-cn_topic_0000001149807881_p549117620284"><a name="zh-cn_topic_0000001149807881_p549117620284"></a><a name="zh-cn_topic_0000001149807881_p549117620284"></a>A2DP(Advanced Audio Distribution Profile )蓝牙设备。</p> 183</td> 184</tr> 185<tr id="zh-cn_topic_0000001149807881_row81701220112812"><td class="cellrowborder" valign="top" width="30.380000000000003%" headers="mcps1.1.4.1.1 "><p id="zh-cn_topic_0000001149807881_p168642028152812"><a name="zh-cn_topic_0000001149807881_p168642028152812"></a><a name="zh-cn_topic_0000001149807881_p168642028152812"></a>MIC</p> 186</td> 187<td class="cellrowborder" valign="top" width="9.950000000000001%" headers="mcps1.1.4.1.2 "><p id="zh-cn_topic_0000001149807881_p517062012812"><a name="zh-cn_topic_0000001149807881_p517062012812"></a><a name="zh-cn_topic_0000001149807881_p517062012812"></a>5</p> 188</td> 189<td class="cellrowborder" valign="top" width="59.67%" headers="mcps1.1.4.1.3 "><p id="zh-cn_topic_0000001149807881_p5170520112813"><a name="zh-cn_topic_0000001149807881_p5170520112813"></a><a name="zh-cn_topic_0000001149807881_p5170520112813"></a>麦克风。</p> 190</td> 191</tr> 192</tbody> 193</table> 194 195## AudioRingMode<sup>7+</sup><a name="zh-cn_topic_0000001149807881_section14948916131018"></a> 196 197枚举,铃声模式。 198 199<a name="zh-cn_topic_0000001149807881_table794961616108"></a> 200<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row189491616171016"><th class="cellrowborder" valign="top" width="30.380000000000003%" id="mcps1.1.4.1.1"><p id="zh-cn_topic_0000001149807881_p15949151616106"><a name="zh-cn_topic_0000001149807881_p15949151616106"></a><a name="zh-cn_topic_0000001149807881_p15949151616106"></a>名称</p> 201</th> 202<th class="cellrowborder" valign="top" width="9.950000000000001%" id="mcps1.1.4.1.2"><p id="zh-cn_topic_0000001149807881_p15949416141012"><a name="zh-cn_topic_0000001149807881_p15949416141012"></a><a name="zh-cn_topic_0000001149807881_p15949416141012"></a>默认值</p> 203</th> 204<th class="cellrowborder" valign="top" width="59.67%" id="mcps1.1.4.1.3"><p id="zh-cn_topic_0000001149807881_p15949216151020"><a name="zh-cn_topic_0000001149807881_p15949216151020"></a><a name="zh-cn_topic_0000001149807881_p15949216151020"></a>描述</p> 205</th> 206</tr> 207</thead> 208<tbody><tr id="zh-cn_topic_0000001149807881_row1094911651010"><td class="cellrowborder" valign="top" width="30.380000000000003%" headers="mcps1.1.4.1.1 "><p id="zh-cn_topic_0000001149807881_p12788943145414"><a name="zh-cn_topic_0000001149807881_p12788943145414"></a><a name="zh-cn_topic_0000001149807881_p12788943145414"></a>RINGER_MODE_SILENT</p> 209</td> 210<td class="cellrowborder" valign="top" width="9.950000000000001%" headers="mcps1.1.4.1.2 "><p id="zh-cn_topic_0000001149807881_p18788114345414"><a name="zh-cn_topic_0000001149807881_p18788114345414"></a><a name="zh-cn_topic_0000001149807881_p18788114345414"></a>0</p> 211</td> 212<td class="cellrowborder" valign="top" width="59.67%" headers="mcps1.1.4.1.3 "><p id="zh-cn_topic_0000001149807881_p1378874385416"><a name="zh-cn_topic_0000001149807881_p1378874385416"></a><a name="zh-cn_topic_0000001149807881_p1378874385416"></a>静音模式</p> 213</td> 214</tr> 215<tr id="zh-cn_topic_0000001149807881_row69495166107"><td class="cellrowborder" valign="top" width="30.380000000000003%" headers="mcps1.1.4.1.1 "><p id="zh-cn_topic_0000001149807881_p1447557125520"><a name="zh-cn_topic_0000001149807881_p1447557125520"></a><a name="zh-cn_topic_0000001149807881_p1447557125520"></a>RINGER_MODE_VIBRATE</p> 216</td> 217<td class="cellrowborder" valign="top" width="9.950000000000001%" headers="mcps1.1.4.1.2 "><p id="zh-cn_topic_0000001149807881_p04766720552"><a name="zh-cn_topic_0000001149807881_p04766720552"></a><a name="zh-cn_topic_0000001149807881_p04766720552"></a>1</p> 218</td> 219<td class="cellrowborder" valign="top" width="59.67%" headers="mcps1.1.4.1.3 "><p id="zh-cn_topic_0000001149807881_p3610191945517"><a name="zh-cn_topic_0000001149807881_p3610191945517"></a><a name="zh-cn_topic_0000001149807881_p3610191945517"></a>震动模式</p> 220</td> 221</tr> 222<tr id="zh-cn_topic_0000001149807881_row49498168105"><td class="cellrowborder" valign="top" width="30.380000000000003%" headers="mcps1.1.4.1.1 "><p id="zh-cn_topic_0000001149807881_p1034891712171"><a name="zh-cn_topic_0000001149807881_p1034891712171"></a><a name="zh-cn_topic_0000001149807881_p1034891712171"></a>RINGER_MODE_NORMAL</p> 223</td> 224<td class="cellrowborder" valign="top" width="9.950000000000001%" headers="mcps1.1.4.1.2 "><p id="zh-cn_topic_0000001149807881_p421692310811"><a name="zh-cn_topic_0000001149807881_p421692310811"></a><a name="zh-cn_topic_0000001149807881_p421692310811"></a>2</p> 225</td> 226<td class="cellrowborder" valign="top" width="59.67%" headers="mcps1.1.4.1.3 "><p id="zh-cn_topic_0000001149807881_p187929346177"><a name="zh-cn_topic_0000001149807881_p187929346177"></a><a name="zh-cn_topic_0000001149807881_p187929346177"></a>响铃模式</p> 227</td> 228</tr> 229</tbody> 230</table> 231 232## AudioManager<a name="zh-cn_topic_0000001149807881_section8265143814015"></a> 233 234管理音频音量和音频设备。 235 236### setVolume\(volumeType: AudioVolumeType, volume: number, callback: AsyncCallback<void\>\): void<a name="zh-cn_topic_0000001149807881_section189141826104616"></a> 237 238设置指定流的音量,使用callback方式返回异步结果。 239 240**参数:** 241 242<a name="zh-cn_topic_0000001149807881_table11004831415"></a> 243<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row1510164861414"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p171154819142"><a name="zh-cn_topic_0000001149807881_p171154819142"></a><a name="zh-cn_topic_0000001149807881_p171154819142"></a>参数名</p> 244</th> 245<th class="cellrowborder" valign="top" width="19.52%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p121164815148"><a name="zh-cn_topic_0000001149807881_p121164815148"></a><a name="zh-cn_topic_0000001149807881_p121164815148"></a>类型</p> 246</th> 247<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p1351547105313"><a name="zh-cn_topic_0000001149807881_p1351547105313"></a><a name="zh-cn_topic_0000001149807881_p1351547105313"></a>必填</p> 248</th> 249<th class="cellrowborder" valign="top" width="55.38999999999999%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p131114812144"><a name="zh-cn_topic_0000001149807881_p131114812144"></a><a name="zh-cn_topic_0000001149807881_p131114812144"></a>说明</p> 250</th> 251</tr> 252</thead> 253<tbody><tr id="zh-cn_topic_0000001149807881_row911124881410"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p11184811420"><a name="zh-cn_topic_0000001149807881_p11184811420"></a><a name="zh-cn_topic_0000001149807881_p11184811420"></a>volumeType</p> 254</td> 255<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p91134810142"><a name="zh-cn_topic_0000001149807881_p91134810142"></a><a name="zh-cn_topic_0000001149807881_p91134810142"></a><a href="#zh-cn_topic_0000001149807881_section92261857172218">AudioVolumeType</a></p> 256</td> 257<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p1751247115312"><a name="zh-cn_topic_0000001149807881_p1751247115312"></a><a name="zh-cn_topic_0000001149807881_p1751247115312"></a>是</p> 258</td> 259<td class="cellrowborder" valign="top" width="55.38999999999999%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p151134811149"><a name="zh-cn_topic_0000001149807881_p151134811149"></a><a name="zh-cn_topic_0000001149807881_p151134811149"></a>音量流类型。</p> 260</td> 261</tr> 262<tr id="zh-cn_topic_0000001149807881_row1811164871417"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p141114817144"><a name="zh-cn_topic_0000001149807881_p141114817144"></a><a name="zh-cn_topic_0000001149807881_p141114817144"></a>volume</p> 263</td> 264<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p1511648151417"><a name="zh-cn_topic_0000001149807881_p1511648151417"></a><a name="zh-cn_topic_0000001149807881_p1511648151417"></a>number</p> 265</td> 266<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p151947175314"><a name="zh-cn_topic_0000001149807881_p151947175314"></a><a name="zh-cn_topic_0000001149807881_p151947175314"></a>是</p> 267</td> 268<td class="cellrowborder" valign="top" width="55.38999999999999%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p16111548121411"><a name="zh-cn_topic_0000001149807881_p16111548121411"></a><a name="zh-cn_topic_0000001149807881_p16111548121411"></a>音量等级,可设置范围通过getMinVolume和getMaxVolume获取。</p> 269</td> 270</tr> 271<tr id="zh-cn_topic_0000001149807881_row85121563158"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p175121965154"><a name="zh-cn_topic_0000001149807881_p175121965154"></a><a name="zh-cn_topic_0000001149807881_p175121965154"></a>callback</p> 272</td> 273<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p1851220691518"><a name="zh-cn_topic_0000001149807881_p1851220691518"></a><a name="zh-cn_topic_0000001149807881_p1851220691518"></a>AsyncCallback<void></p> 274</td> 275<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p15134711532"><a name="zh-cn_topic_0000001149807881_p15134711532"></a><a name="zh-cn_topic_0000001149807881_p15134711532"></a>是</p> 276</td> 277<td class="cellrowborder" valign="top" width="55.38999999999999%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p751211651512"><a name="zh-cn_topic_0000001149807881_p751211651512"></a><a name="zh-cn_topic_0000001149807881_p751211651512"></a>回调表示成功还是失败。</p> 278</td> 279</tr> 280</tbody> 281</table> 282 283**返回值:** 284 285无 286 287**示例:** 288 289``` 290audioManager.setVolume(audio.AudioVolumeType.MEDIA, 10, (err)=>{ 291 if (err) { 292 console.error('Failed to set the volume. ${err.message}'); 293 return; 294 } 295 console.log('Callback invoked to indicate a successful volume setting.'); 296}) 297``` 298 299### setVolume\(volumeType: AudioVolumeType, volume: number\): Promise<void\><a name="zh-cn_topic_0000001149807881_section102021249114612"></a> 300 301设置指定流的音量,使用promise方式返回异步结果。 302 303**参数:** 304 305<a name="zh-cn_topic_0000001149807881_table20688181818176"></a> 306<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row1368810188176"><th class="cellrowborder" valign="top" width="17.599999999999998%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p5688818171712"><a name="zh-cn_topic_0000001149807881_p5688818171712"></a><a name="zh-cn_topic_0000001149807881_p5688818171712"></a>参数名</p> 307</th> 308<th class="cellrowborder" valign="top" width="19.49%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p8688118111719"><a name="zh-cn_topic_0000001149807881_p8688118111719"></a><a name="zh-cn_topic_0000001149807881_p8688118111719"></a>类型</p> 309</th> 310<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p1994792215711"><a name="zh-cn_topic_0000001149807881_p1994792215711"></a><a name="zh-cn_topic_0000001149807881_p1994792215711"></a>必填</p> 311</th> 312<th class="cellrowborder" valign="top" width="55.38999999999999%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p12688151816173"><a name="zh-cn_topic_0000001149807881_p12688151816173"></a><a name="zh-cn_topic_0000001149807881_p12688151816173"></a>说明</p> 313</th> 314</tr> 315</thead> 316<tbody><tr id="zh-cn_topic_0000001149807881_row0688518171714"><td class="cellrowborder" valign="top" width="17.599999999999998%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p1368820182174"><a name="zh-cn_topic_0000001149807881_p1368820182174"></a><a name="zh-cn_topic_0000001149807881_p1368820182174"></a>volumeType</p> 317</td> 318<td class="cellrowborder" valign="top" width="19.49%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p116881518111712"><a name="zh-cn_topic_0000001149807881_p116881518111712"></a><a name="zh-cn_topic_0000001149807881_p116881518111712"></a><a href="#zh-cn_topic_0000001149807881_section92261857172218">AudioVolumeType</a></p> 319</td> 320<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p2094702218579"><a name="zh-cn_topic_0000001149807881_p2094702218579"></a><a name="zh-cn_topic_0000001149807881_p2094702218579"></a>是</p> 321</td> 322<td class="cellrowborder" valign="top" width="55.38999999999999%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p1688131812176"><a name="zh-cn_topic_0000001149807881_p1688131812176"></a><a name="zh-cn_topic_0000001149807881_p1688131812176"></a>音量流类型。</p> 323</td> 324</tr> 325<tr id="zh-cn_topic_0000001149807881_row5688218131711"><td class="cellrowborder" valign="top" width="17.599999999999998%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p176881618181715"><a name="zh-cn_topic_0000001149807881_p176881618181715"></a><a name="zh-cn_topic_0000001149807881_p176881618181715"></a>volume</p> 326</td> 327<td class="cellrowborder" valign="top" width="19.49%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p5688201811720"><a name="zh-cn_topic_0000001149807881_p5688201811720"></a><a name="zh-cn_topic_0000001149807881_p5688201811720"></a>number</p> 328</td> 329<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p79472226579"><a name="zh-cn_topic_0000001149807881_p79472226579"></a><a name="zh-cn_topic_0000001149807881_p79472226579"></a>是</p> 330</td> 331<td class="cellrowborder" valign="top" width="55.38999999999999%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p2688718171716"><a name="zh-cn_topic_0000001149807881_p2688718171716"></a><a name="zh-cn_topic_0000001149807881_p2688718171716"></a>音量等级,可设置范围通过getMinVolume和getMaxVolume获取。</p> 332</td> 333</tr> 334</tbody> 335</table> 336 337**返回值:** 338 339<a name="zh-cn_topic_0000001149807881_table106721328171713"></a> 340<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row9672122817176"><th class="cellrowborder" valign="top" width="26.06%" id="mcps1.1.3.1.1"><p id="zh-cn_topic_0000001149807881_p106728288171"><a name="zh-cn_topic_0000001149807881_p106728288171"></a><a name="zh-cn_topic_0000001149807881_p106728288171"></a>类型</p> 341</th> 342<th class="cellrowborder" valign="top" width="73.94%" id="mcps1.1.3.1.2"><p id="zh-cn_topic_0000001149807881_p5672112817178"><a name="zh-cn_topic_0000001149807881_p5672112817178"></a><a name="zh-cn_topic_0000001149807881_p5672112817178"></a>说明</p> 343</th> 344</tr> 345</thead> 346<tbody><tr id="zh-cn_topic_0000001149807881_row06721528191711"><td class="cellrowborder" valign="top" width="26.06%" headers="mcps1.1.3.1.1 "><p id="zh-cn_topic_0000001149807881_p107821612171919"><a name="zh-cn_topic_0000001149807881_p107821612171919"></a><a name="zh-cn_topic_0000001149807881_p107821612171919"></a>Promise<void></p> 347</td> 348<td class="cellrowborder" valign="top" width="73.94%" headers="mcps1.1.3.1.2 "><p id="zh-cn_topic_0000001149807881_p4672828141718"><a name="zh-cn_topic_0000001149807881_p4672828141718"></a><a name="zh-cn_topic_0000001149807881_p4672828141718"></a>Promise回调表示成功还是失败。</p> 349</td> 350</tr> 351</tbody> 352</table> 353 354**示例:** 355 356``` 357audioManager.setVolume(audio.AudioVolumeType.MEDIA, 10).then(()=> 358 console.log('Promise returned to indicate a successful volume setting.'); 359) 360``` 361 362### getVolume\(volumeType: AudioVolumeType, callback: AsyncCallback<number\>\): void<a name="zh-cn_topic_0000001149807881_section4387320194714"></a> 363 364获取指定流的音量,使用callback方式返回异步结果。 365 366**参数:** 367 368<a name="zh-cn_topic_0000001149807881_table44323134204"></a> 369<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row16433171322017"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p1943319132201"><a name="zh-cn_topic_0000001149807881_p1943319132201"></a><a name="zh-cn_topic_0000001149807881_p1943319132201"></a>参数名</p> 370</th> 371<th class="cellrowborder" valign="top" width="19.52%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p143314139203"><a name="zh-cn_topic_0000001149807881_p143314139203"></a><a name="zh-cn_topic_0000001149807881_p143314139203"></a>类型</p> 372</th> 373<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p1540765014581"><a name="zh-cn_topic_0000001149807881_p1540765014581"></a><a name="zh-cn_topic_0000001149807881_p1540765014581"></a>必填</p> 374</th> 375<th class="cellrowborder" valign="top" width="55.38999999999999%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p10433181362011"><a name="zh-cn_topic_0000001149807881_p10433181362011"></a><a name="zh-cn_topic_0000001149807881_p10433181362011"></a>说明</p> 376</th> 377</tr> 378</thead> 379<tbody><tr id="zh-cn_topic_0000001149807881_row4433913122010"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p54331513192018"><a name="zh-cn_topic_0000001149807881_p54331513192018"></a><a name="zh-cn_topic_0000001149807881_p54331513192018"></a>volumeType</p> 380</td> 381<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p182075544714"><a name="zh-cn_topic_0000001149807881_p182075544714"></a><a name="zh-cn_topic_0000001149807881_p182075544714"></a><a href="#zh-cn_topic_0000001149807881_section92261857172218">AudioVolumeType</a></p> 382</td> 383<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p3407185013588"><a name="zh-cn_topic_0000001149807881_p3407185013588"></a><a name="zh-cn_topic_0000001149807881_p3407185013588"></a>是</p> 384</td> 385<td class="cellrowborder" valign="top" width="55.38999999999999%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p44331613142018"><a name="zh-cn_topic_0000001149807881_p44331613142018"></a><a name="zh-cn_topic_0000001149807881_p44331613142018"></a>音量流类型。</p> 386</td> 387</tr> 388<tr id="zh-cn_topic_0000001149807881_row743331372014"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p143341319205"><a name="zh-cn_topic_0000001149807881_p143341319205"></a><a name="zh-cn_topic_0000001149807881_p143341319205"></a>callback</p> 389</td> 390<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p1043316137200"><a name="zh-cn_topic_0000001149807881_p1043316137200"></a><a name="zh-cn_topic_0000001149807881_p1043316137200"></a>AsyncCallback<number></p> 391</td> 392<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p12659352195818"><a name="zh-cn_topic_0000001149807881_p12659352195818"></a><a name="zh-cn_topic_0000001149807881_p12659352195818"></a>是</p> 393</td> 394<td class="cellrowborder" valign="top" width="55.38999999999999%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p3433161313204"><a name="zh-cn_topic_0000001149807881_p3433161313204"></a><a name="zh-cn_topic_0000001149807881_p3433161313204"></a>回调返回音量大小。</p> 395</td> 396</tr> 397</tbody> 398</table> 399 400**返回值:** 401 402无 403 404**示例:** 405 406``` 407audioManager.getVolume(audio.AudioVolumeType.MEDIA, (err, value) => { 408 if (err) { 409 console.error('Failed to obtain the volume. ${err.message}'); 410 return; 411 } 412 console.log('Callback invoked to indicate that the volume is obtained.'); 413}) 414``` 415 416### getVolume\(volumeType: AudioVolumeType\): Promise<number\><a name="zh-cn_topic_0000001149807881_section04121965119"></a> 417 418获取指定流的音量,使用promise方式返回异步结果。 419 420**参数:** 421 422<a name="zh-cn_topic_0000001149807881_table174341113202016"></a> 423<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row843416136203"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p143410134207"><a name="zh-cn_topic_0000001149807881_p143410134207"></a><a name="zh-cn_topic_0000001149807881_p143410134207"></a>参数名</p> 424</th> 425<th class="cellrowborder" valign="top" width="19.52%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p6434813182016"><a name="zh-cn_topic_0000001149807881_p6434813182016"></a><a name="zh-cn_topic_0000001149807881_p6434813182016"></a>类型</p> 426</th> 427<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p418721165918"><a name="zh-cn_topic_0000001149807881_p418721165918"></a><a name="zh-cn_topic_0000001149807881_p418721165918"></a>必填</p> 428</th> 429<th class="cellrowborder" valign="top" width="55.38999999999999%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p943491320207"><a name="zh-cn_topic_0000001149807881_p943491320207"></a><a name="zh-cn_topic_0000001149807881_p943491320207"></a>说明</p> 430</th> 431</tr> 432</thead> 433<tbody><tr id="zh-cn_topic_0000001149807881_row5434181312207"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p144343134206"><a name="zh-cn_topic_0000001149807881_p144343134206"></a><a name="zh-cn_topic_0000001149807881_p144343134206"></a>volumeType</p> 434</td> 435<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p121741711487"><a name="zh-cn_topic_0000001149807881_p121741711487"></a><a name="zh-cn_topic_0000001149807881_p121741711487"></a><a href="#zh-cn_topic_0000001149807881_section92261857172218">AudioVolumeType</a></p> 436</td> 437<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p118791205914"><a name="zh-cn_topic_0000001149807881_p118791205914"></a><a name="zh-cn_topic_0000001149807881_p118791205914"></a>是</p> 438</td> 439<td class="cellrowborder" valign="top" width="55.38999999999999%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p6434613122010"><a name="zh-cn_topic_0000001149807881_p6434613122010"></a><a name="zh-cn_topic_0000001149807881_p6434613122010"></a>音量流类型。</p> 440</td> 441</tr> 442</tbody> 443</table> 444 445**返回值:** 446 447<a name="zh-cn_topic_0000001149807881_table11435101313201"></a> 448<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row9435191332013"><th class="cellrowborder" valign="top" width="25.97%" id="mcps1.1.3.1.1"><p id="zh-cn_topic_0000001149807881_p7435131352019"><a name="zh-cn_topic_0000001149807881_p7435131352019"></a><a name="zh-cn_topic_0000001149807881_p7435131352019"></a>类型</p> 449</th> 450<th class="cellrowborder" valign="top" width="74.03%" id="mcps1.1.3.1.2"><p id="zh-cn_topic_0000001149807881_p343521362017"><a name="zh-cn_topic_0000001149807881_p343521362017"></a><a name="zh-cn_topic_0000001149807881_p343521362017"></a>说明</p> 451</th> 452</tr> 453</thead> 454<tbody><tr id="zh-cn_topic_0000001149807881_row1143515137209"><td class="cellrowborder" valign="top" width="25.97%" headers="mcps1.1.3.1.1 "><p id="zh-cn_topic_0000001149807881_p3435171318201"><a name="zh-cn_topic_0000001149807881_p3435171318201"></a><a name="zh-cn_topic_0000001149807881_p3435171318201"></a>Promise<number></p> 455</td> 456<td class="cellrowborder" valign="top" width="74.03%" headers="mcps1.1.3.1.2 "><p id="zh-cn_topic_0000001149807881_p17435513102016"><a name="zh-cn_topic_0000001149807881_p17435513102016"></a><a name="zh-cn_topic_0000001149807881_p17435513102016"></a>Promise回调返回音量大小。</p> 457</td> 458</tr> 459</tbody> 460</table> 461 462**示例:** 463 464``` 465audioManager.getVolume(audio.AudioVolumeType.MEDIA).then((value) => 466 console.log('Promise returned to indicate that the volume is obtained.' + value); 467) 468``` 469 470### getMinVolume\(volumeType: AudioVolumeType, callback: AsyncCallback<number\>\): void<a name="zh-cn_topic_0000001149807881_section188714283511"></a> 471 472获取指定流的最小音量,使用callback方式返回异步结果。 473 474**参数:** 475 476<a name="zh-cn_topic_0000001149807881_table9585157122219"></a> 477<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row95857713228"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p1358510710223"><a name="zh-cn_topic_0000001149807881_p1358510710223"></a><a name="zh-cn_topic_0000001149807881_p1358510710223"></a>参数名</p> 478</th> 479<th class="cellrowborder" valign="top" width="19.52%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p958577152214"><a name="zh-cn_topic_0000001149807881_p958577152214"></a><a name="zh-cn_topic_0000001149807881_p958577152214"></a>类型</p> 480</th> 481<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p12979171810590"><a name="zh-cn_topic_0000001149807881_p12979171810590"></a><a name="zh-cn_topic_0000001149807881_p12979171810590"></a>必填</p> 482</th> 483<th class="cellrowborder" valign="top" width="55.38999999999999%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p85851579221"><a name="zh-cn_topic_0000001149807881_p85851579221"></a><a name="zh-cn_topic_0000001149807881_p85851579221"></a>说明</p> 484</th> 485</tr> 486</thead> 487<tbody><tr id="zh-cn_topic_0000001149807881_row7585373227"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p105852712216"><a name="zh-cn_topic_0000001149807881_p105852712216"></a><a name="zh-cn_topic_0000001149807881_p105852712216"></a>volumeType</p> 488</td> 489<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p1862714319487"><a name="zh-cn_topic_0000001149807881_p1862714319487"></a><a name="zh-cn_topic_0000001149807881_p1862714319487"></a><a href="#zh-cn_topic_0000001149807881_section92261857172218">AudioVolumeType</a></p> 490</td> 491<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p59791018125916"><a name="zh-cn_topic_0000001149807881_p59791018125916"></a><a name="zh-cn_topic_0000001149807881_p59791018125916"></a>是</p> 492</td> 493<td class="cellrowborder" valign="top" width="55.38999999999999%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p758517710222"><a name="zh-cn_topic_0000001149807881_p758517710222"></a><a name="zh-cn_topic_0000001149807881_p758517710222"></a>音量流类型。</p> 494</td> 495</tr> 496<tr id="zh-cn_topic_0000001149807881_row165851718222"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p115866772214"><a name="zh-cn_topic_0000001149807881_p115866772214"></a><a name="zh-cn_topic_0000001149807881_p115866772214"></a>callback</p> 497</td> 498<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p558614719222"><a name="zh-cn_topic_0000001149807881_p558614719222"></a><a name="zh-cn_topic_0000001149807881_p558614719222"></a>AsyncCallback<number></p> 499</td> 500<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p89791518185916"><a name="zh-cn_topic_0000001149807881_p89791518185916"></a><a name="zh-cn_topic_0000001149807881_p89791518185916"></a>是</p> 501</td> 502<td class="cellrowborder" valign="top" width="55.38999999999999%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p1958614711221"><a name="zh-cn_topic_0000001149807881_p1958614711221"></a><a name="zh-cn_topic_0000001149807881_p1958614711221"></a>回调返回最小音量。</p> 503</td> 504</tr> 505</tbody> 506</table> 507 508**返回值:** 509 510无 511 512**示例:** 513 514``` 515audioManager.getMinVolume(audio.AudioVolumeType.MEDIA, (err, value) => { 516 if (err) { 517 console.error('Failed to obtain the minimum volume. ${err.message}'); 518 return; 519 } 520 console.log('Callback invoked to indicate that the minimum volume is obtained.' + value); 521}) 522``` 523 524### getMinVolume\(volumeType: AudioVolumeType\): Promise<number\><a name="zh-cn_topic_0000001149807881_section41556389511"></a> 525 526获取指定流的最小音量,使用promise方式返回异步结果。 527 528**参数:** 529 530<a name="zh-cn_topic_0000001149807881_table558627102215"></a> 531<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row175868714227"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p1758619712217"><a name="zh-cn_topic_0000001149807881_p1758619712217"></a><a name="zh-cn_topic_0000001149807881_p1758619712217"></a>参数名</p> 532</th> 533<th class="cellrowborder" valign="top" width="19.52%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p12586776227"><a name="zh-cn_topic_0000001149807881_p12586776227"></a><a name="zh-cn_topic_0000001149807881_p12586776227"></a>类型</p> 534</th> 535<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p94861627165914"><a name="zh-cn_topic_0000001149807881_p94861627165914"></a><a name="zh-cn_topic_0000001149807881_p94861627165914"></a>必填</p> 536</th> 537<th class="cellrowborder" valign="top" width="55.38999999999999%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p85862711223"><a name="zh-cn_topic_0000001149807881_p85862711223"></a><a name="zh-cn_topic_0000001149807881_p85862711223"></a>说明</p> 538</th> 539</tr> 540</thead> 541<tbody><tr id="zh-cn_topic_0000001149807881_row65861477221"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p5586167172217"><a name="zh-cn_topic_0000001149807881_p5586167172217"></a><a name="zh-cn_topic_0000001149807881_p5586167172217"></a>volumeType</p> 542</td> 543<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p592519511485"><a name="zh-cn_topic_0000001149807881_p592519511485"></a><a name="zh-cn_topic_0000001149807881_p592519511485"></a><a href="#zh-cn_topic_0000001149807881_section92261857172218">AudioVolumeType</a></p> 544</td> 545<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p2048622713593"><a name="zh-cn_topic_0000001149807881_p2048622713593"></a><a name="zh-cn_topic_0000001149807881_p2048622713593"></a>是</p> 546</td> 547<td class="cellrowborder" valign="top" width="55.38999999999999%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p135871079226"><a name="zh-cn_topic_0000001149807881_p135871079226"></a><a name="zh-cn_topic_0000001149807881_p135871079226"></a>音量流类型。</p> 548</td> 549</tr> 550</tbody> 551</table> 552 553**返回值:** 554 555<a name="zh-cn_topic_0000001149807881_table35874718223"></a> 556<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row1558718715227"><th class="cellrowborder" valign="top" width="26.02%" id="mcps1.1.3.1.1"><p id="zh-cn_topic_0000001149807881_p75871715226"><a name="zh-cn_topic_0000001149807881_p75871715226"></a><a name="zh-cn_topic_0000001149807881_p75871715226"></a>类型</p> 557</th> 558<th class="cellrowborder" valign="top" width="73.98%" id="mcps1.1.3.1.2"><p id="zh-cn_topic_0000001149807881_p85871720225"><a name="zh-cn_topic_0000001149807881_p85871720225"></a><a name="zh-cn_topic_0000001149807881_p85871720225"></a>说明</p> 559</th> 560</tr> 561</thead> 562<tbody><tr id="zh-cn_topic_0000001149807881_row1458710714221"><td class="cellrowborder" valign="top" width="26.02%" headers="mcps1.1.3.1.1 "><p id="zh-cn_topic_0000001149807881_p558737142218"><a name="zh-cn_topic_0000001149807881_p558737142218"></a><a name="zh-cn_topic_0000001149807881_p558737142218"></a>Promise<number></p> 563</td> 564<td class="cellrowborder" valign="top" width="73.98%" headers="mcps1.1.3.1.2 "><p id="zh-cn_topic_0000001149807881_p05878717229"><a name="zh-cn_topic_0000001149807881_p05878717229"></a><a name="zh-cn_topic_0000001149807881_p05878717229"></a>Promise回调返回最小音量。</p> 565</td> 566</tr> 567</tbody> 568</table> 569 570**示例:** 571 572``` 573audioManager.getMinVolume(audio.AudioVolumeType.MEDIA).then((value) => 574 console.log('Promised returned to indicate that the minimum volume is obtained.' + value); 575) 576``` 577 578### getMaxVolume\(volumeType: AudioVolumeType, callback: AsyncCallback<number\>\): void<a name="zh-cn_topic_0000001149807881_section690395418516"></a> 579 580获取指定流的最大音量,使用callback方式返回异步结果。 581 582**参数:** 583 584<a name="zh-cn_topic_0000001149807881_table7210144262214"></a> 585<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row7210104242215"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p521018428221"><a name="zh-cn_topic_0000001149807881_p521018428221"></a><a name="zh-cn_topic_0000001149807881_p521018428221"></a>参数名</p> 586</th> 587<th class="cellrowborder" valign="top" width="19.52%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p102107424223"><a name="zh-cn_topic_0000001149807881_p102107424223"></a><a name="zh-cn_topic_0000001149807881_p102107424223"></a>类型</p> 588</th> 589<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p167531439593"><a name="zh-cn_topic_0000001149807881_p167531439593"></a><a name="zh-cn_topic_0000001149807881_p167531439593"></a>必填</p> 590</th> 591<th class="cellrowborder" valign="top" width="55.38999999999999%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p1521054292218"><a name="zh-cn_topic_0000001149807881_p1521054292218"></a><a name="zh-cn_topic_0000001149807881_p1521054292218"></a>说明</p> 592</th> 593</tr> 594</thead> 595<tbody><tr id="zh-cn_topic_0000001149807881_row321010428228"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p5210642132212"><a name="zh-cn_topic_0000001149807881_p5210642132212"></a><a name="zh-cn_topic_0000001149807881_p5210642132212"></a>volumeType</p> 596</td> 597<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p35691288487"><a name="zh-cn_topic_0000001149807881_p35691288487"></a><a name="zh-cn_topic_0000001149807881_p35691288487"></a><a href="#zh-cn_topic_0000001149807881_section92261857172218">AudioVolumeType</a></p> 598</td> 599<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p14753114317590"><a name="zh-cn_topic_0000001149807881_p14753114317590"></a><a name="zh-cn_topic_0000001149807881_p14753114317590"></a>是</p> 600</td> 601<td class="cellrowborder" valign="top" width="55.38999999999999%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p8210242112217"><a name="zh-cn_topic_0000001149807881_p8210242112217"></a><a name="zh-cn_topic_0000001149807881_p8210242112217"></a>音量流类型。</p> 602</td> 603</tr> 604<tr id="zh-cn_topic_0000001149807881_row82115429227"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p4211842132218"><a name="zh-cn_topic_0000001149807881_p4211842132218"></a><a name="zh-cn_topic_0000001149807881_p4211842132218"></a>callback</p> 605</td> 606<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p8211114232217"><a name="zh-cn_topic_0000001149807881_p8211114232217"></a><a name="zh-cn_topic_0000001149807881_p8211114232217"></a>AsyncCallback<number></p> 607</td> 608<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p1275384315910"><a name="zh-cn_topic_0000001149807881_p1275384315910"></a><a name="zh-cn_topic_0000001149807881_p1275384315910"></a>是</p> 609</td> 610<td class="cellrowborder" valign="top" width="55.38999999999999%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p1621114282212"><a name="zh-cn_topic_0000001149807881_p1621114282212"></a><a name="zh-cn_topic_0000001149807881_p1621114282212"></a>回调返回最大音量大小。</p> 611</td> 612</tr> 613</tbody> 614</table> 615 616**返回值:** 617 618无 619 620**示例:** 621 622``` 623audioManager.getMaxVolume(audio.AudioVolumeType.MEDIA, (err, value) => { 624 if (err) { 625 console.error('Failed to obtain the maximum volume. ${err.message}'); 626 return; 627 } 628 console.log('Callback invoked to indicate that the maximum volume is obtained.' + value); 629}) 630``` 631 632### getMaxVolume\(volumeType: AudioVolumeType\): Promise<number\><a name="zh-cn_topic_0000001149807881_section155151345217"></a> 633 634获取指定流的最大音量,使用promise方式返回异步结果。 635 636**参数:** 637 638<a name="zh-cn_topic_0000001149807881_table11211104210226"></a> 639<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row42111424228"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p14211842162217"><a name="zh-cn_topic_0000001149807881_p14211842162217"></a><a name="zh-cn_topic_0000001149807881_p14211842162217"></a>参数名</p> 640</th> 641<th class="cellrowborder" valign="top" width="20.54%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p7211184211223"><a name="zh-cn_topic_0000001149807881_p7211184211223"></a><a name="zh-cn_topic_0000001149807881_p7211184211223"></a>类型</p> 642</th> 643<th class="cellrowborder" valign="top" width="8.72%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p165812523592"><a name="zh-cn_topic_0000001149807881_p165812523592"></a><a name="zh-cn_topic_0000001149807881_p165812523592"></a>必填</p> 644</th> 645<th class="cellrowborder" valign="top" width="53.169999999999995%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p821164232217"><a name="zh-cn_topic_0000001149807881_p821164232217"></a><a name="zh-cn_topic_0000001149807881_p821164232217"></a>说明</p> 646</th> 647</tr> 648</thead> 649<tbody><tr id="zh-cn_topic_0000001149807881_row22111742112216"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p152121542152218"><a name="zh-cn_topic_0000001149807881_p152121542152218"></a><a name="zh-cn_topic_0000001149807881_p152121542152218"></a>volumeType</p> 650</td> 651<td class="cellrowborder" valign="top" width="20.54%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p9479411164814"><a name="zh-cn_topic_0000001149807881_p9479411164814"></a><a name="zh-cn_topic_0000001149807881_p9479411164814"></a><a href="#zh-cn_topic_0000001149807881_section92261857172218">AudioVolumeType</a></p> 652</td> 653<td class="cellrowborder" valign="top" width="8.72%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p45811752165910"><a name="zh-cn_topic_0000001149807881_p45811752165910"></a><a name="zh-cn_topic_0000001149807881_p45811752165910"></a>是</p> 654</td> 655<td class="cellrowborder" valign="top" width="53.169999999999995%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p1021294292216"><a name="zh-cn_topic_0000001149807881_p1021294292216"></a><a name="zh-cn_topic_0000001149807881_p1021294292216"></a>音量流类型。</p> 656</td> 657</tr> 658</tbody> 659</table> 660 661**返回值:** 662 663<a name="zh-cn_topic_0000001149807881_table621215425220"></a> 664<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row3212842112215"><th class="cellrowborder" valign="top" width="26.02%" id="mcps1.1.3.1.1"><p id="zh-cn_topic_0000001149807881_p521274272216"><a name="zh-cn_topic_0000001149807881_p521274272216"></a><a name="zh-cn_topic_0000001149807881_p521274272216"></a>类型</p> 665</th> 666<th class="cellrowborder" valign="top" width="73.98%" id="mcps1.1.3.1.2"><p id="zh-cn_topic_0000001149807881_p1121214215221"><a name="zh-cn_topic_0000001149807881_p1121214215221"></a><a name="zh-cn_topic_0000001149807881_p1121214215221"></a>说明</p> 667</th> 668</tr> 669</thead> 670<tbody><tr id="zh-cn_topic_0000001149807881_row12121442192216"><td class="cellrowborder" valign="top" width="26.02%" headers="mcps1.1.3.1.1 "><p id="zh-cn_topic_0000001149807881_p72128426221"><a name="zh-cn_topic_0000001149807881_p72128426221"></a><a name="zh-cn_topic_0000001149807881_p72128426221"></a>Promise<number></p> 671</td> 672<td class="cellrowborder" valign="top" width="73.98%" headers="mcps1.1.3.1.2 "><p id="zh-cn_topic_0000001149807881_p4212114210226"><a name="zh-cn_topic_0000001149807881_p4212114210226"></a><a name="zh-cn_topic_0000001149807881_p4212114210226"></a>Promise回调返回最大音量大小。</p> 673</td> 674</tr> 675</tbody> 676</table> 677 678**示例:** 679 680``` 681audioManager.getMaxVolume(audio.AudioVolumeType.MEDIA).then((data)=> 682 console.log('Promised returned to indicate that the maximum volume is obtained.'); 683) 684``` 685 686### mute\(volumeType: AudioVolumeType, mute: boolean, callback: AsyncCallback<void\>\): void<sup>7+</sup><a name="zh-cn_topic_0000001149807881_section13516136134613"></a> 687 688设置指定音量流静音,使用callback方式返回异步结果。 689 690**参数:** 691 692<a name="zh-cn_topic_0000001149807881_table16516183634618"></a> 693<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row35162369464"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p1751663624620"><a name="zh-cn_topic_0000001149807881_p1751663624620"></a><a name="zh-cn_topic_0000001149807881_p1751663624620"></a>参数名</p> 694</th> 695<th class="cellrowborder" valign="top" width="19.52%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p10517193604610"><a name="zh-cn_topic_0000001149807881_p10517193604610"></a><a name="zh-cn_topic_0000001149807881_p10517193604610"></a>类型</p> 696</th> 697<th class="cellrowborder" valign="top" width="8.97%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p75178369466"><a name="zh-cn_topic_0000001149807881_p75178369466"></a><a name="zh-cn_topic_0000001149807881_p75178369466"></a>必填</p> 698</th> 699<th class="cellrowborder" valign="top" width="53.94%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p135173369461"><a name="zh-cn_topic_0000001149807881_p135173369461"></a><a name="zh-cn_topic_0000001149807881_p135173369461"></a>说明</p> 700</th> 701</tr> 702</thead> 703<tbody><tr id="zh-cn_topic_0000001149807881_row14517123611463"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p1051753654616"><a name="zh-cn_topic_0000001149807881_p1051753654616"></a><a name="zh-cn_topic_0000001149807881_p1051753654616"></a>volumeType</p> 704</td> 705<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p19517183664611"><a name="zh-cn_topic_0000001149807881_p19517183664611"></a><a name="zh-cn_topic_0000001149807881_p19517183664611"></a><a href="#zh-cn_topic_0000001149807881_section92261857172218">AudioVolumeType</a></p> 706</td> 707<td class="cellrowborder" valign="top" width="8.97%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p14517113634613"><a name="zh-cn_topic_0000001149807881_p14517113634613"></a><a name="zh-cn_topic_0000001149807881_p14517113634613"></a>是</p> 708</td> 709<td class="cellrowborder" valign="top" width="53.94%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p412912394120"><a name="zh-cn_topic_0000001149807881_p412912394120"></a><a name="zh-cn_topic_0000001149807881_p412912394120"></a>音量流类型。</p> 710</td> 711</tr> 712<tr id="zh-cn_topic_0000001149807881_row051703612469"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p8518436144612"><a name="zh-cn_topic_0000001149807881_p8518436144612"></a><a name="zh-cn_topic_0000001149807881_p8518436144612"></a>mute</p> 713</td> 714<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p592111217487"><a name="zh-cn_topic_0000001149807881_p592111217487"></a><a name="zh-cn_topic_0000001149807881_p592111217487"></a>boolean</p> 715</td> 716<td class="cellrowborder" valign="top" width="8.97%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p145187366468"><a name="zh-cn_topic_0000001149807881_p145187366468"></a><a name="zh-cn_topic_0000001149807881_p145187366468"></a>是</p> 717</td> 718<td class="cellrowborder" valign="top" width="53.94%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p11518133684618"><a name="zh-cn_topic_0000001149807881_p11518133684618"></a><a name="zh-cn_topic_0000001149807881_p11518133684618"></a>静音状态,true为静音,false为非静音。</p> 719</td> 720</tr> 721<tr id="zh-cn_topic_0000001149807881_row351833624617"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p1651817365464"><a name="zh-cn_topic_0000001149807881_p1651817365464"></a><a name="zh-cn_topic_0000001149807881_p1651817365464"></a>callback</p> 722</td> 723<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p451813613462"><a name="zh-cn_topic_0000001149807881_p451813613462"></a><a name="zh-cn_topic_0000001149807881_p451813613462"></a>AsyncCallback<void></p> 724</td> 725<td class="cellrowborder" valign="top" width="8.97%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p65181636194618"><a name="zh-cn_topic_0000001149807881_p65181636194618"></a><a name="zh-cn_topic_0000001149807881_p65181636194618"></a>是</p> 726</td> 727<td class="cellrowborder" valign="top" width="53.94%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p18115237124119"><a name="zh-cn_topic_0000001149807881_p18115237124119"></a><a name="zh-cn_topic_0000001149807881_p18115237124119"></a>回调表示成功还是失败。</p> 728</td> 729</tr> 730</tbody> 731</table> 732 733**返回值:** 734 735无 736 737**示例:** 738 739``` 740audioManager.mute(audio.AudioVolumeType.MEDIA, true, (err) => { 741 if (err) { 742 console.error('Failed to mute the stream. ${err.message}'); 743 return; 744 } 745 console.log('Callback invoked to indicate that the stream is muted.'); 746}) 747``` 748 749### mute\(volumeType: AudioVolumeType, mute: boolean\): Promise<void\><sup>7+</sup><a name="zh-cn_topic_0000001149807881_section7519036144616"></a> 750 751设置指定音量流静音,使用promise方式返回异步结果。 752 753**参数:** 754 755<a name="zh-cn_topic_0000001149807881_table9519103616467"></a> 756<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row12519123684618"><th class="cellrowborder" valign="top" width="17.599999999999998%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p7885132645511"><a name="zh-cn_topic_0000001149807881_p7885132645511"></a><a name="zh-cn_topic_0000001149807881_p7885132645511"></a>参数名</p> 757</th> 758<th class="cellrowborder" valign="top" width="19.49%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p98856261553"><a name="zh-cn_topic_0000001149807881_p98856261553"></a><a name="zh-cn_topic_0000001149807881_p98856261553"></a>类型</p> 759</th> 760<th class="cellrowborder" valign="top" width="9.950000000000001%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p1388582618559"><a name="zh-cn_topic_0000001149807881_p1388582618559"></a><a name="zh-cn_topic_0000001149807881_p1388582618559"></a>必填</p> 761</th> 762<th class="cellrowborder" valign="top" width="52.959999999999994%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p688512261558"><a name="zh-cn_topic_0000001149807881_p688512261558"></a><a name="zh-cn_topic_0000001149807881_p688512261558"></a>说明</p> 763</th> 764</tr> 765</thead> 766<tbody><tr id="zh-cn_topic_0000001149807881_row552093624612"><td class="cellrowborder" valign="top" width="17.599999999999998%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p1052023616462"><a name="zh-cn_topic_0000001149807881_p1052023616462"></a><a name="zh-cn_topic_0000001149807881_p1052023616462"></a>volumeType</p> 767</td> 768<td class="cellrowborder" valign="top" width="19.49%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p552013620468"><a name="zh-cn_topic_0000001149807881_p552013620468"></a><a name="zh-cn_topic_0000001149807881_p552013620468"></a><a href="#zh-cn_topic_0000001149807881_section92261857172218">AudioVolumeType</a></p> 769</td> 770<td class="cellrowborder" valign="top" width="9.950000000000001%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p85203364468"><a name="zh-cn_topic_0000001149807881_p85203364468"></a><a name="zh-cn_topic_0000001149807881_p85203364468"></a>是</p> 771</td> 772<td class="cellrowborder" valign="top" width="52.959999999999994%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p05201036124617"><a name="zh-cn_topic_0000001149807881_p05201036124617"></a><a name="zh-cn_topic_0000001149807881_p05201036124617"></a>音量流类型。</p> 773</td> 774</tr> 775<tr id="zh-cn_topic_0000001149807881_row7520143614463"><td class="cellrowborder" valign="top" width="17.599999999999998%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p9522436134617"><a name="zh-cn_topic_0000001149807881_p9522436134617"></a><a name="zh-cn_topic_0000001149807881_p9522436134617"></a>mute</p> 776</td> 777<td class="cellrowborder" valign="top" width="19.49%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p12440205013243"><a name="zh-cn_topic_0000001149807881_p12440205013243"></a><a name="zh-cn_topic_0000001149807881_p12440205013243"></a>boolean</p> 778</td> 779<td class="cellrowborder" valign="top" width="9.950000000000001%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p15221236134617"><a name="zh-cn_topic_0000001149807881_p15221236134617"></a><a name="zh-cn_topic_0000001149807881_p15221236134617"></a>是</p> 780</td> 781<td class="cellrowborder" valign="top" width="52.959999999999994%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p1079311161421"><a name="zh-cn_topic_0000001149807881_p1079311161421"></a><a name="zh-cn_topic_0000001149807881_p1079311161421"></a>静音状态,true为静音,false为非静音。</p> 782</td> 783</tr> 784</tbody> 785</table> 786 787**返回值:** 788 789<a name="zh-cn_topic_0000001149807881_table1152273694614"></a> 790<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row352213367467"><th class="cellrowborder" valign="top" width="26.06%" id="mcps1.1.3.1.1"><p id="zh-cn_topic_0000001149807881_p16791154010553"><a name="zh-cn_topic_0000001149807881_p16791154010553"></a><a name="zh-cn_topic_0000001149807881_p16791154010553"></a>类型</p> 791</th> 792<th class="cellrowborder" valign="top" width="73.94%" id="mcps1.1.3.1.2"><p id="zh-cn_topic_0000001149807881_p117911040155511"><a name="zh-cn_topic_0000001149807881_p117911040155511"></a><a name="zh-cn_topic_0000001149807881_p117911040155511"></a>说明</p> 793</th> 794</tr> 795</thead> 796<tbody><tr id="zh-cn_topic_0000001149807881_row185231369468"><td class="cellrowborder" valign="top" width="26.06%" headers="mcps1.1.3.1.1 "><p id="zh-cn_topic_0000001149807881_p25231836174612"><a name="zh-cn_topic_0000001149807881_p25231836174612"></a><a name="zh-cn_topic_0000001149807881_p25231836174612"></a>Promise<void></p> 797</td> 798<td class="cellrowborder" valign="top" width="73.94%" headers="mcps1.1.3.1.2 "><p id="zh-cn_topic_0000001149807881_p18347134724215"><a name="zh-cn_topic_0000001149807881_p18347134724215"></a><a name="zh-cn_topic_0000001149807881_p18347134724215"></a>Promise回调表示成功还是失败。</p> 799</td> 800</tr> 801</tbody> 802</table> 803 804**示例:** 805 806``` 807audioManager.mute(audio.AudioVolumeType.MEDIA, true).then(() => 808 console.log('Promise returned to indicate that the stream is muted.'); 809) 810``` 811 812### isMute\(volumeType: AudioVolumeType, callback: AsyncCallback<boolean\>\): void<sup>7+</sup><a name="zh-cn_topic_0000001149807881_section10684183819585"></a> 813 814获取指定音量流是否被静音,使用callback方式返回异步结果。 815 816**参数:** 817 818<a name="zh-cn_topic_0000001149807881_table26841038115812"></a> 819<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row166859386584"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p1077814316558"><a name="zh-cn_topic_0000001149807881_p1077814316558"></a><a name="zh-cn_topic_0000001149807881_p1077814316558"></a>参数名</p> 820</th> 821<th class="cellrowborder" valign="top" width="19.52%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p67781331135518"><a name="zh-cn_topic_0000001149807881_p67781331135518"></a><a name="zh-cn_topic_0000001149807881_p67781331135518"></a>类型</p> 822</th> 823<th class="cellrowborder" valign="top" width="10.56%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p1177819312556"><a name="zh-cn_topic_0000001149807881_p1177819312556"></a><a name="zh-cn_topic_0000001149807881_p1177819312556"></a>必填</p> 824</th> 825<th class="cellrowborder" valign="top" width="52.349999999999994%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p177816317552"><a name="zh-cn_topic_0000001149807881_p177816317552"></a><a name="zh-cn_topic_0000001149807881_p177816317552"></a>说明</p> 826</th> 827</tr> 828</thead> 829<tbody><tr id="zh-cn_topic_0000001149807881_row14685163820583"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p668543875817"><a name="zh-cn_topic_0000001149807881_p668543875817"></a><a name="zh-cn_topic_0000001149807881_p668543875817"></a>volumeType</p> 830</td> 831<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p1268653815581"><a name="zh-cn_topic_0000001149807881_p1268653815581"></a><a name="zh-cn_topic_0000001149807881_p1268653815581"></a><a href="#zh-cn_topic_0000001149807881_section92261857172218">AudioVolumeType</a></p> 832</td> 833<td class="cellrowborder" valign="top" width="10.56%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p12686123814583"><a name="zh-cn_topic_0000001149807881_p12686123814583"></a><a name="zh-cn_topic_0000001149807881_p12686123814583"></a>是</p> 834</td> 835<td class="cellrowborder" valign="top" width="52.349999999999994%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p6947181918459"><a name="zh-cn_topic_0000001149807881_p6947181918459"></a><a name="zh-cn_topic_0000001149807881_p6947181918459"></a>音量流类型。</p> 836</td> 837</tr> 838<tr id="zh-cn_topic_0000001149807881_row15686153825819"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p5686153895817"><a name="zh-cn_topic_0000001149807881_p5686153895817"></a><a name="zh-cn_topic_0000001149807881_p5686153895817"></a>callback</p> 839</td> 840<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p16869387581"><a name="zh-cn_topic_0000001149807881_p16869387581"></a><a name="zh-cn_topic_0000001149807881_p16869387581"></a>AsyncCallback<boolean></p> 841</td> 842<td class="cellrowborder" valign="top" width="10.56%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p4686163865811"><a name="zh-cn_topic_0000001149807881_p4686163865811"></a><a name="zh-cn_topic_0000001149807881_p4686163865811"></a>是</p> 843</td> 844<td class="cellrowborder" valign="top" width="52.349999999999994%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p183723274511"><a name="zh-cn_topic_0000001149807881_p183723274511"></a><a name="zh-cn_topic_0000001149807881_p183723274511"></a>回调返回流静音状态,true为静音,false为非静音。</p> 845</td> 846</tr> 847</tbody> 848</table> 849 850**返回值:** 851 852无 853 854**示例:** 855 856``` 857audioManager.isMute(audio.AudioVolumeType.MEDIA, (err, value) => { 858 if (err) { 859 console.error('Failed to obtain the mute status. ${err.message}'); 860 return; 861 } 862 console.log('Callback invoked to indicate that the mute status of the stream is obtained.' + value); 863}) 864``` 865 866### isMute\(volumeType: AudioVolumeType\): Promise<boolean\><sup>7+</sup><a name="zh-cn_topic_0000001149807881_section6920211145610"></a> 867 868获取指定音量流是否被静音,使用promise方式返回异步结果。 869 870**参数:** 871 872<a name="zh-cn_topic_0000001149807881_table179201611155614"></a> 873<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row9920911195617"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p873322815570"><a name="zh-cn_topic_0000001149807881_p873322815570"></a><a name="zh-cn_topic_0000001149807881_p873322815570"></a>参数名</p> 874</th> 875<th class="cellrowborder" valign="top" width="19.52%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p87331028115717"><a name="zh-cn_topic_0000001149807881_p87331028115717"></a><a name="zh-cn_topic_0000001149807881_p87331028115717"></a>类型</p> 876</th> 877<th class="cellrowborder" valign="top" width="9.94%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p47331128105710"><a name="zh-cn_topic_0000001149807881_p47331128105710"></a><a name="zh-cn_topic_0000001149807881_p47331128105710"></a>必填</p> 878</th> 879<th class="cellrowborder" valign="top" width="52.96999999999999%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p373318281575"><a name="zh-cn_topic_0000001149807881_p373318281575"></a><a name="zh-cn_topic_0000001149807881_p373318281575"></a>说明</p> 880</th> 881</tr> 882</thead> 883<tbody><tr id="zh-cn_topic_0000001149807881_row1292111110560"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p149211311135618"><a name="zh-cn_topic_0000001149807881_p149211311135618"></a><a name="zh-cn_topic_0000001149807881_p149211311135618"></a>volumeType</p> 884</td> 885<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p1692191110568"><a name="zh-cn_topic_0000001149807881_p1692191110568"></a><a name="zh-cn_topic_0000001149807881_p1692191110568"></a><a href="#zh-cn_topic_0000001149807881_section92261857172218">AudioVolumeType</a></p> 886</td> 887<td class="cellrowborder" valign="top" width="9.94%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p1921131145612"><a name="zh-cn_topic_0000001149807881_p1921131145612"></a><a name="zh-cn_topic_0000001149807881_p1921131145612"></a>是</p> 888</td> 889<td class="cellrowborder" valign="top" width="52.96999999999999%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p12726822462"><a name="zh-cn_topic_0000001149807881_p12726822462"></a><a name="zh-cn_topic_0000001149807881_p12726822462"></a>音量流类型。</p> 890</td> 891</tr> 892</tbody> 893</table> 894 895**返回值:** 896 897<a name="zh-cn_topic_0000001149807881_table1392211113567"></a> 898<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row39224110565"><th class="cellrowborder" valign="top" width="25.97%" id="mcps1.1.3.1.1"><p id="zh-cn_topic_0000001149807881_p1532894520558"><a name="zh-cn_topic_0000001149807881_p1532894520558"></a><a name="zh-cn_topic_0000001149807881_p1532894520558"></a>类型</p> 899</th> 900<th class="cellrowborder" valign="top" width="74.03%" id="mcps1.1.3.1.2"><p id="zh-cn_topic_0000001149807881_p16328114517555"><a name="zh-cn_topic_0000001149807881_p16328114517555"></a><a name="zh-cn_topic_0000001149807881_p16328114517555"></a>说明</p> 901</th> 902</tr> 903</thead> 904<tbody><tr id="zh-cn_topic_0000001149807881_row8922161155612"><td class="cellrowborder" valign="top" width="25.97%" headers="mcps1.1.3.1.1 "><p id="zh-cn_topic_0000001149807881_p992211117566"><a name="zh-cn_topic_0000001149807881_p992211117566"></a><a name="zh-cn_topic_0000001149807881_p992211117566"></a>Promise<boolean></p> 905</td> 906<td class="cellrowborder" valign="top" width="74.03%" headers="mcps1.1.3.1.2 "><p id="zh-cn_topic_0000001149807881_p17922131112568"><a name="zh-cn_topic_0000001149807881_p17922131112568"></a><a name="zh-cn_topic_0000001149807881_p17922131112568"></a>Promise回调返回流静音状态,true为静音,false为非静音。</p> 907</td> 908</tr> 909</tbody> 910</table> 911 912**示例:** 913 914``` 915audioManager.isMute(audio.AudioVolumeType.MEDIA).then((value) => 916 console.log('Promise returned to indicate that the mute status of the stream is obtained.' + value); 917) 918``` 919 920### isActive\(volumeType: AudioVolumeType, callback: AsyncCallback<boolean\>\): void<sup>7+</sup><a name="zh-cn_topic_0000001149807881_section380012544121"></a> 921 922获取指定音量流是否为活跃状态,使用callback方式返回异步结果。 923 924**参数:** 925 926<a name="zh-cn_topic_0000001149807881_table11801954151215"></a> 927<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row480175481211"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p16771626115716"><a name="zh-cn_topic_0000001149807881_p16771626115716"></a><a name="zh-cn_topic_0000001149807881_p16771626115716"></a>参数名</p> 928</th> 929<th class="cellrowborder" valign="top" width="19.52%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p146771226195712"><a name="zh-cn_topic_0000001149807881_p146771226195712"></a><a name="zh-cn_topic_0000001149807881_p146771226195712"></a>类型</p> 930</th> 931<th class="cellrowborder" valign="top" width="9.78%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p16678202665719"><a name="zh-cn_topic_0000001149807881_p16678202665719"></a><a name="zh-cn_topic_0000001149807881_p16678202665719"></a>必填</p> 932</th> 933<th class="cellrowborder" valign="top" width="53.13%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p867882665719"><a name="zh-cn_topic_0000001149807881_p867882665719"></a><a name="zh-cn_topic_0000001149807881_p867882665719"></a>说明</p> 934</th> 935</tr> 936</thead> 937<tbody><tr id="zh-cn_topic_0000001149807881_row6802165481211"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p138023547121"><a name="zh-cn_topic_0000001149807881_p138023547121"></a><a name="zh-cn_topic_0000001149807881_p138023547121"></a>volumeType</p> 938</td> 939<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p168021543125"><a name="zh-cn_topic_0000001149807881_p168021543125"></a><a name="zh-cn_topic_0000001149807881_p168021543125"></a><a href="#zh-cn_topic_0000001149807881_section92261857172218">AudioVolumeType</a></p> 940</td> 941<td class="cellrowborder" valign="top" width="9.78%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p1180275418128"><a name="zh-cn_topic_0000001149807881_p1180275418128"></a><a name="zh-cn_topic_0000001149807881_p1180275418128"></a>是</p> 942</td> 943<td class="cellrowborder" valign="top" width="53.13%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p106221941204617"><a name="zh-cn_topic_0000001149807881_p106221941204617"></a><a name="zh-cn_topic_0000001149807881_p106221941204617"></a>音量流类型。</p> 944</td> 945</tr> 946<tr id="zh-cn_topic_0000001149807881_row148021654111218"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p1280275410128"><a name="zh-cn_topic_0000001149807881_p1280275410128"></a><a name="zh-cn_topic_0000001149807881_p1280275410128"></a>callback</p> 947</td> 948<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p1680245411214"><a name="zh-cn_topic_0000001149807881_p1680245411214"></a><a name="zh-cn_topic_0000001149807881_p1680245411214"></a>AsyncCallback<boolean></p> 949</td> 950<td class="cellrowborder" valign="top" width="9.78%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p198031054151212"><a name="zh-cn_topic_0000001149807881_p198031054151212"></a><a name="zh-cn_topic_0000001149807881_p198031054151212"></a>是</p> 951</td> 952<td class="cellrowborder" valign="top" width="53.13%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p2803354131214"><a name="zh-cn_topic_0000001149807881_p2803354131214"></a><a name="zh-cn_topic_0000001149807881_p2803354131214"></a>回调返回流的活跃状态,true为活跃,false为不活跃。</p> 953</td> 954</tr> 955</tbody> 956</table> 957 958**返回值:** 959 960无 961 962**示例:** 963 964``` 965audioManager.isActive(audio.AudioVolumeType.MEDIA, (err, value) => { 966 if (err) { 967 console.error('Failed to obtain the active status of the stream. ${err.message}'); 968 return; 969 } 970 console.log('Callback invoked to indicate that the active status of the stream is obtained.' + value); 971}) 972``` 973 974### isActive\(volumeType: AudioVolumeType\): Promise<boolean\><sup>7+</sup><a name="zh-cn_topic_0000001149807881_section1880315481216"></a> 975 976获取指定音量流是否为活跃状态,使用promise方式返回异步结果。 977 978**参数:** 979 980<a name="zh-cn_topic_0000001149807881_table18041954171217"></a> 981<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row18804154151212"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p1162310248571"><a name="zh-cn_topic_0000001149807881_p1162310248571"></a><a name="zh-cn_topic_0000001149807881_p1162310248571"></a>参数名</p> 982</th> 983<th class="cellrowborder" valign="top" width="19.52%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p262322411572"><a name="zh-cn_topic_0000001149807881_p262322411572"></a><a name="zh-cn_topic_0000001149807881_p262322411572"></a>类型</p> 984</th> 985<th class="cellrowborder" valign="top" width="9.43%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p13623152455711"><a name="zh-cn_topic_0000001149807881_p13623152455711"></a><a name="zh-cn_topic_0000001149807881_p13623152455711"></a>必填</p> 986</th> 987<th class="cellrowborder" valign="top" width="53.480000000000004%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p186231724165714"><a name="zh-cn_topic_0000001149807881_p186231724165714"></a><a name="zh-cn_topic_0000001149807881_p186231724165714"></a>说明</p> 988</th> 989</tr> 990</thead> 991<tbody><tr id="zh-cn_topic_0000001149807881_row8805115411211"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p118051544122"><a name="zh-cn_topic_0000001149807881_p118051544122"></a><a name="zh-cn_topic_0000001149807881_p118051544122"></a>volumeType</p> 992</td> 993<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p19805145415124"><a name="zh-cn_topic_0000001149807881_p19805145415124"></a><a name="zh-cn_topic_0000001149807881_p19805145415124"></a><a href="#zh-cn_topic_0000001149807881_section92261857172218">AudioVolumeType</a></p> 994</td> 995<td class="cellrowborder" valign="top" width="9.43%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p380585411216"><a name="zh-cn_topic_0000001149807881_p380585411216"></a><a name="zh-cn_topic_0000001149807881_p380585411216"></a>是</p> 996</td> 997<td class="cellrowborder" valign="top" width="53.480000000000004%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p1238516185410"><a name="zh-cn_topic_0000001149807881_p1238516185410"></a><a name="zh-cn_topic_0000001149807881_p1238516185410"></a>音量流类型。</p> 998</td> 999</tr> 1000</tbody> 1001</table> 1002 1003**返回值:** 1004 1005<a name="zh-cn_topic_0000001149807881_table1380613543122"></a> 1006<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row2806125411129"><th class="cellrowborder" valign="top" width="25.97%" id="mcps1.1.3.1.1"><p id="zh-cn_topic_0000001149807881_p07811652175517"><a name="zh-cn_topic_0000001149807881_p07811652175517"></a><a name="zh-cn_topic_0000001149807881_p07811652175517"></a>类型</p> 1007</th> 1008<th class="cellrowborder" valign="top" width="74.03%" id="mcps1.1.3.1.2"><p id="zh-cn_topic_0000001149807881_p478112526558"><a name="zh-cn_topic_0000001149807881_p478112526558"></a><a name="zh-cn_topic_0000001149807881_p478112526558"></a>说明</p> 1009</th> 1010</tr> 1011</thead> 1012<tbody><tr id="zh-cn_topic_0000001149807881_row680605491218"><td class="cellrowborder" valign="top" width="25.97%" headers="mcps1.1.3.1.1 "><p id="zh-cn_topic_0000001149807881_p138061054101212"><a name="zh-cn_topic_0000001149807881_p138061054101212"></a><a name="zh-cn_topic_0000001149807881_p138061054101212"></a>Promise<boolean></p> 1013</td> 1014<td class="cellrowborder" valign="top" width="74.03%" headers="mcps1.1.3.1.2 "><p id="zh-cn_topic_0000001149807881_p280615541125"><a name="zh-cn_topic_0000001149807881_p280615541125"></a><a name="zh-cn_topic_0000001149807881_p280615541125"></a>Promise回调返回流的活跃状态,true为活跃,false为不活跃。</p> 1015</td> 1016</tr> 1017</tbody> 1018</table> 1019 1020**示例:** 1021 1022``` 1023audioManager.isActive(audio.AudioVolumeType.MEDIA).then((value) => 1024 console.log('Promise returned to indicate that the active status of the stream is obtained.' + value); 1025) 1026``` 1027 1028### setRingerMode\(mode: AudioRingMode, callback: AsyncCallback<void\>\): void<sup>7+</sup><a name="zh-cn_topic_0000001149807881_section18572131483613"></a> 1029 1030设置铃声模式,使用callback方式返回异步结果。 1031 1032**参数:** 1033 1034<a name="zh-cn_topic_0000001149807881_table157219143361"></a> 1035<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row1357221412365"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p1175132113575"><a name="zh-cn_topic_0000001149807881_p1175132113575"></a><a name="zh-cn_topic_0000001149807881_p1175132113575"></a>参数名</p> 1036</th> 1037<th class="cellrowborder" valign="top" width="19.52%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p1375122116572"><a name="zh-cn_topic_0000001149807881_p1375122116572"></a><a name="zh-cn_topic_0000001149807881_p1375122116572"></a>类型</p> 1038</th> 1039<th class="cellrowborder" valign="top" width="10.56%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p1375122115710"><a name="zh-cn_topic_0000001149807881_p1375122115710"></a><a name="zh-cn_topic_0000001149807881_p1375122115710"></a>必填</p> 1040</th> 1041<th class="cellrowborder" valign="top" width="52.349999999999994%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p18751521135717"><a name="zh-cn_topic_0000001149807881_p18751521135717"></a><a name="zh-cn_topic_0000001149807881_p18751521135717"></a>说明</p> 1042</th> 1043</tr> 1044</thead> 1045<tbody><tr id="zh-cn_topic_0000001149807881_row14573171411369"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p55731714143611"><a name="zh-cn_topic_0000001149807881_p55731714143611"></a><a name="zh-cn_topic_0000001149807881_p55731714143611"></a>mode</p> 1046</td> 1047<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p185881627122214"><a name="zh-cn_topic_0000001149807881_p185881627122214"></a><a name="zh-cn_topic_0000001149807881_p185881627122214"></a><a href="#zh-cn_topic_0000001149807881_section14948916131018">AudioRingMode</a></p> 1048</td> 1049<td class="cellrowborder" valign="top" width="10.56%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p35731514193617"><a name="zh-cn_topic_0000001149807881_p35731514193617"></a><a name="zh-cn_topic_0000001149807881_p35731514193617"></a>是</p> 1050</td> 1051<td class="cellrowborder" valign="top" width="52.349999999999994%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p8573191453617"><a name="zh-cn_topic_0000001149807881_p8573191453617"></a><a name="zh-cn_topic_0000001149807881_p8573191453617"></a>音频铃声模式。</p> 1052</td> 1053</tr> 1054<tr id="zh-cn_topic_0000001149807881_row165731014143611"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p357416149361"><a name="zh-cn_topic_0000001149807881_p357416149361"></a><a name="zh-cn_topic_0000001149807881_p357416149361"></a>callback</p> 1055</td> 1056<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p1457491463618"><a name="zh-cn_topic_0000001149807881_p1457491463618"></a><a name="zh-cn_topic_0000001149807881_p1457491463618"></a>AsyncCallback<void></p> 1057</td> 1058<td class="cellrowborder" valign="top" width="10.56%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p95741514103617"><a name="zh-cn_topic_0000001149807881_p95741514103617"></a><a name="zh-cn_topic_0000001149807881_p95741514103617"></a>是</p> 1059</td> 1060<td class="cellrowborder" valign="top" width="52.349999999999994%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p19574514123617"><a name="zh-cn_topic_0000001149807881_p19574514123617"></a><a name="zh-cn_topic_0000001149807881_p19574514123617"></a>回调返回设置成功或失败。</p> 1061</td> 1062</tr> 1063</tbody> 1064</table> 1065 1066**返回值:** 1067 1068无 1069 1070**示例:** 1071 1072``` 1073audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_NORMAL, (err) => { 1074 if (err) { 1075 console.error('Failed to set the ringer mode. ${err.message}'); 1076 return; 1077 } 1078 console.log('Callback invoked to indicate a successful setting of the ringer mode.'); 1079}) 1080``` 1081 1082### setRingerMode\(mode: AudioRingMode\): Promise<void\><sup>7+</sup><a name="zh-cn_topic_0000001149807881_section55741914143615"></a> 1083 1084设置铃声模式,使用promise方式返回异步结果。 1085 1086**参数:** 1087 1088<a name="zh-cn_topic_0000001149807881_table55743147369"></a> 1089<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row557512147369"><th class="cellrowborder" valign="top" width="17.599999999999998%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p86951317155710"><a name="zh-cn_topic_0000001149807881_p86951317155710"></a><a name="zh-cn_topic_0000001149807881_p86951317155710"></a>参数名</p> 1090</th> 1091<th class="cellrowborder" valign="top" width="19.49%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p13695101705716"><a name="zh-cn_topic_0000001149807881_p13695101705716"></a><a name="zh-cn_topic_0000001149807881_p13695101705716"></a>类型</p> 1092</th> 1093<th class="cellrowborder" valign="top" width="9.08%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p7695717175715"><a name="zh-cn_topic_0000001149807881_p7695717175715"></a><a name="zh-cn_topic_0000001149807881_p7695717175715"></a>必填</p> 1094</th> 1095<th class="cellrowborder" valign="top" width="53.83%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p2695181775710"><a name="zh-cn_topic_0000001149807881_p2695181775710"></a><a name="zh-cn_topic_0000001149807881_p2695181775710"></a>说明</p> 1096</th> 1097</tr> 1098</thead> 1099<tbody><tr id="zh-cn_topic_0000001149807881_row10575131412368"><td class="cellrowborder" valign="top" width="17.599999999999998%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p1957571420365"><a name="zh-cn_topic_0000001149807881_p1957571420365"></a><a name="zh-cn_topic_0000001149807881_p1957571420365"></a>mode</p> 1100</td> 1101<td class="cellrowborder" valign="top" width="19.49%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p14224197645"><a name="zh-cn_topic_0000001149807881_p14224197645"></a><a name="zh-cn_topic_0000001149807881_p14224197645"></a><a href="#zh-cn_topic_0000001149807881_section14948916131018">AudioRingMode</a></p> 1102</td> 1103<td class="cellrowborder" valign="top" width="9.08%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p9575191416367"><a name="zh-cn_topic_0000001149807881_p9575191416367"></a><a name="zh-cn_topic_0000001149807881_p9575191416367"></a>是</p> 1104</td> 1105<td class="cellrowborder" valign="top" width="53.83%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p10576214143620"><a name="zh-cn_topic_0000001149807881_p10576214143620"></a><a name="zh-cn_topic_0000001149807881_p10576214143620"></a>音频铃声模式。</p> 1106</td> 1107</tr> 1108</tbody> 1109</table> 1110 1111**返回值:** 1112 1113<a name="zh-cn_topic_0000001149807881_table145763146361"></a> 1114<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row1576101403610"><th class="cellrowborder" valign="top" width="26.06%" id="mcps1.1.3.1.1"><p id="zh-cn_topic_0000001149807881_p465818212561"><a name="zh-cn_topic_0000001149807881_p465818212561"></a><a name="zh-cn_topic_0000001149807881_p465818212561"></a>类型</p> 1115</th> 1116<th class="cellrowborder" valign="top" width="73.94%" id="mcps1.1.3.1.2"><p id="zh-cn_topic_0000001149807881_p2065832195616"><a name="zh-cn_topic_0000001149807881_p2065832195616"></a><a name="zh-cn_topic_0000001149807881_p2065832195616"></a>说明</p> 1117</th> 1118</tr> 1119</thead> 1120<tbody><tr id="zh-cn_topic_0000001149807881_row1257711144362"><td class="cellrowborder" valign="top" width="26.06%" headers="mcps1.1.3.1.1 "><p id="zh-cn_topic_0000001149807881_p1577714143613"><a name="zh-cn_topic_0000001149807881_p1577714143613"></a><a name="zh-cn_topic_0000001149807881_p1577714143613"></a>Promise<void></p> 1121</td> 1122<td class="cellrowborder" valign="top" width="73.94%" headers="mcps1.1.3.1.2 "><p id="zh-cn_topic_0000001149807881_p20577181420364"><a name="zh-cn_topic_0000001149807881_p20577181420364"></a><a name="zh-cn_topic_0000001149807881_p20577181420364"></a>Promise回调返回设置成功或失败。</p> 1123</td> 1124</tr> 1125</tbody> 1126</table> 1127 1128**示例:** 1129 1130``` 1131audioManager.setRingerMode(audio.AudioRingMode.RINGER_MODE_NORMAL).then(() => 1132 console.log('Promise returned to indicate a successful setting of the ringer mode.'); 1133) 1134``` 1135 1136### getRingerMode\(callback: AsyncCallback<AudioRingMode\>\): void<sup>7+</sup><a name="zh-cn_topic_0000001149807881_section149044108162"></a> 1137 1138获取铃声模式,使用callback方式返回异步结果。 1139 1140**参数:** 1141 1142<a name="zh-cn_topic_0000001149807881_table139051710191611"></a> 1143<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row6905910101619"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p67261514145710"><a name="zh-cn_topic_0000001149807881_p67261514145710"></a><a name="zh-cn_topic_0000001149807881_p67261514145710"></a>参数名</p> 1144</th> 1145<th class="cellrowborder" valign="top" width="22.71%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p177261314145713"><a name="zh-cn_topic_0000001149807881_p177261314145713"></a><a name="zh-cn_topic_0000001149807881_p177261314145713"></a>类型</p> 1146</th> 1147<th class="cellrowborder" valign="top" width="9.8%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p1672610143573"><a name="zh-cn_topic_0000001149807881_p1672610143573"></a><a name="zh-cn_topic_0000001149807881_p1672610143573"></a>必填</p> 1148</th> 1149<th class="cellrowborder" valign="top" width="49.919999999999995%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p27268142573"><a name="zh-cn_topic_0000001149807881_p27268142573"></a><a name="zh-cn_topic_0000001149807881_p27268142573"></a>说明</p> 1150</th> 1151</tr> 1152</thead> 1153<tbody><tr id="zh-cn_topic_0000001149807881_row690717102164"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p2907191071616"><a name="zh-cn_topic_0000001149807881_p2907191071616"></a><a name="zh-cn_topic_0000001149807881_p2907191071616"></a>callback</p> 1154</td> 1155<td class="cellrowborder" valign="top" width="22.71%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p1490712109166"><a name="zh-cn_topic_0000001149807881_p1490712109166"></a><a name="zh-cn_topic_0000001149807881_p1490712109166"></a>AsyncCallback<<a href="#zh-cn_topic_0000001149807881_section14948916131018">AudioRingMode</a>></p> 1156</td> 1157<td class="cellrowborder" valign="top" width="9.8%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p12907181051618"><a name="zh-cn_topic_0000001149807881_p12907181051618"></a><a name="zh-cn_topic_0000001149807881_p12907181051618"></a>是</p> 1158</td> 1159<td class="cellrowborder" valign="top" width="49.919999999999995%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p1890771019169"><a name="zh-cn_topic_0000001149807881_p1890771019169"></a><a name="zh-cn_topic_0000001149807881_p1890771019169"></a>回调返回系统的铃声模式。</p> 1160</td> 1161</tr> 1162</tbody> 1163</table> 1164 1165**返回值:** 1166 1167无 1168 1169**示例:** 1170 1171``` 1172audioManager.getRingerMode((err, value) => { 1173 if (err) { 1174 console.error('Failed to obtain the ringer mode. ${err.message}'); 1175 return; 1176 } 1177 console.log('Callback invoked to indicate that the ringer mode is obtained.' + value); 1178}) 1179``` 1180 1181### getRingerMode\(\): Promise<AudioRingMode\><sup>7+</sup><a name="zh-cn_topic_0000001149807881_section13908210101620"></a> 1182 1183获取铃声模式,使用promise方式返回异步结果。 1184 1185**参数:** 1186 1187无 1188 1189**返回值:** 1190 1191<a name="zh-cn_topic_0000001149807881_table59092010111611"></a> 1192<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row1290901017161"><th class="cellrowborder" valign="top" width="25.97%" id="mcps1.1.3.1.1"><p id="zh-cn_topic_0000001149807881_p138856135611"><a name="zh-cn_topic_0000001149807881_p138856135611"></a><a name="zh-cn_topic_0000001149807881_p138856135611"></a>类型</p> 1193</th> 1194<th class="cellrowborder" valign="top" width="74.03%" id="mcps1.1.3.1.2"><p id="zh-cn_topic_0000001149807881_p03899675614"><a name="zh-cn_topic_0000001149807881_p03899675614"></a><a name="zh-cn_topic_0000001149807881_p03899675614"></a>说明</p> 1195</th> 1196</tr> 1197</thead> 1198<tbody><tr id="zh-cn_topic_0000001149807881_row14910121071610"><td class="cellrowborder" valign="top" width="25.97%" headers="mcps1.1.3.1.1 "><p id="zh-cn_topic_0000001149807881_p191031031611"><a name="zh-cn_topic_0000001149807881_p191031031611"></a><a name="zh-cn_topic_0000001149807881_p191031031611"></a>Promise<<a href="#zh-cn_topic_0000001149807881_section14948916131018">AudioRingMode</a>></p> 1199</td> 1200<td class="cellrowborder" valign="top" width="74.03%" headers="mcps1.1.3.1.2 "><p id="zh-cn_topic_0000001149807881_p17910141021611"><a name="zh-cn_topic_0000001149807881_p17910141021611"></a><a name="zh-cn_topic_0000001149807881_p17910141021611"></a>Promise回调返回系统的铃声模式。</p> 1201</td> 1202</tr> 1203</tbody> 1204</table> 1205 1206**示例:** 1207 1208``` 1209audioManager.getRingerMode().then((value) => 1210 console.log('Promise returned to indicate that the ringer mode is obtained.' + value); 1211) 1212``` 1213 1214### setAudioParameter\(key: string, value: string, callback: AsyncCallback<void\>\): void<sup>7+</sup><a name="zh-cn_topic_0000001149807881_section1691957174818"></a> 1215 1216音频参数设置,使用callback方式返回异步结果。 1217 1218**参数:** 1219 1220<a name="zh-cn_topic_0000001149807881_table59175774814"></a> 1221<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row31075754816"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p134771411145711"><a name="zh-cn_topic_0000001149807881_p134771411145711"></a><a name="zh-cn_topic_0000001149807881_p134771411145711"></a>参数名</p> 1222</th> 1223<th class="cellrowborder" valign="top" width="19.52%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p64779113577"><a name="zh-cn_topic_0000001149807881_p64779113577"></a><a name="zh-cn_topic_0000001149807881_p64779113577"></a>类型</p> 1224</th> 1225<th class="cellrowborder" valign="top" width="9.08%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p14477311155717"><a name="zh-cn_topic_0000001149807881_p14477311155717"></a><a name="zh-cn_topic_0000001149807881_p14477311155717"></a>必填</p> 1226</th> 1227<th class="cellrowborder" valign="top" width="53.83%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p1347701112574"><a name="zh-cn_topic_0000001149807881_p1347701112574"></a><a name="zh-cn_topic_0000001149807881_p1347701112574"></a>说明</p> 1228</th> 1229</tr> 1230</thead> 1231<tbody><tr id="zh-cn_topic_0000001149807881_row1210257154813"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p310105784818"><a name="zh-cn_topic_0000001149807881_p310105784818"></a><a name="zh-cn_topic_0000001149807881_p310105784818"></a>key</p> 1232</td> 1233<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p1438102417524"><a name="zh-cn_topic_0000001149807881_p1438102417524"></a><a name="zh-cn_topic_0000001149807881_p1438102417524"></a>string</p> 1234</td> 1235<td class="cellrowborder" valign="top" width="9.08%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p811195717481"><a name="zh-cn_topic_0000001149807881_p811195717481"></a><a name="zh-cn_topic_0000001149807881_p811195717481"></a>是</p> 1236</td> 1237<td class="cellrowborder" valign="top" width="53.83%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p10117574484"><a name="zh-cn_topic_0000001149807881_p10117574484"></a><a name="zh-cn_topic_0000001149807881_p10117574484"></a>被设置的音频参数的键。</p> 1238</td> 1239</tr> 1240<tr id="zh-cn_topic_0000001149807881_row16111057124817"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p1159793235211"><a name="zh-cn_topic_0000001149807881_p1159793235211"></a><a name="zh-cn_topic_0000001149807881_p1159793235211"></a>value</p> 1241</td> 1242<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p19461139165212"><a name="zh-cn_topic_0000001149807881_p19461139165212"></a><a name="zh-cn_topic_0000001149807881_p19461139165212"></a>string</p> 1243</td> 1244<td class="cellrowborder" valign="top" width="9.08%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p91155718487"><a name="zh-cn_topic_0000001149807881_p91155718487"></a><a name="zh-cn_topic_0000001149807881_p91155718487"></a>是</p> 1245</td> 1246<td class="cellrowborder" valign="top" width="53.83%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p13111157164816"><a name="zh-cn_topic_0000001149807881_p13111157164816"></a><a name="zh-cn_topic_0000001149807881_p13111157164816"></a>被设置的音频参数的值。</p> 1247</td> 1248</tr> 1249<tr id="zh-cn_topic_0000001149807881_row611205754810"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p31235754812"><a name="zh-cn_topic_0000001149807881_p31235754812"></a><a name="zh-cn_topic_0000001149807881_p31235754812"></a>callback</p> 1250</td> 1251<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p11255718483"><a name="zh-cn_topic_0000001149807881_p11255718483"></a><a name="zh-cn_topic_0000001149807881_p11255718483"></a>AsyncCallback<void></p> 1252</td> 1253<td class="cellrowborder" valign="top" width="9.08%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p101255744812"><a name="zh-cn_topic_0000001149807881_p101255744812"></a><a name="zh-cn_topic_0000001149807881_p101255744812"></a>是</p> 1254</td> 1255<td class="cellrowborder" valign="top" width="53.83%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p91220576488"><a name="zh-cn_topic_0000001149807881_p91220576488"></a><a name="zh-cn_topic_0000001149807881_p91220576488"></a>回调返回设置成功或失败。</p> 1256</td> 1257</tr> 1258</tbody> 1259</table> 1260 1261**返回值:** 1262 1263无 1264 1265**示例:** 1266 1267``` 1268audioManager.setAudioParameter('PBits per sample', '8 bit', (err) => { 1269 if (err) { 1270 console.error('Failed to set the audio parameter. ${err.message}'); 1271 return; 1272 } 1273 console.log('Callback invoked to indicate a successful setting of the audio parameter.'); 1274}) 1275``` 1276 1277### setAudioParameter\(key: string, value: string\): Promise<void\><sup>7+</sup><a name="zh-cn_topic_0000001149807881_section18121057174820"></a> 1278 1279音频参数设置,使用promise方式返回异步结果。 1280 1281**参数:** 1282 1283<a name="zh-cn_topic_0000001149807881_table18121957164810"></a> 1284<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row1139578486"><th class="cellrowborder" valign="top" width="17.599999999999998%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p658416785710"><a name="zh-cn_topic_0000001149807881_p658416785710"></a><a name="zh-cn_topic_0000001149807881_p658416785710"></a>参数名</p> 1285</th> 1286<th class="cellrowborder" valign="top" width="19.49%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p175849775719"><a name="zh-cn_topic_0000001149807881_p175849775719"></a><a name="zh-cn_topic_0000001149807881_p175849775719"></a>类型</p> 1287</th> 1288<th class="cellrowborder" valign="top" width="9.78%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p4584578579"><a name="zh-cn_topic_0000001149807881_p4584578579"></a><a name="zh-cn_topic_0000001149807881_p4584578579"></a>必填</p> 1289</th> 1290<th class="cellrowborder" valign="top" width="53.13%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p10585577570"><a name="zh-cn_topic_0000001149807881_p10585577570"></a><a name="zh-cn_topic_0000001149807881_p10585577570"></a>说明</p> 1291</th> 1292</tr> 1293</thead> 1294<tbody><tr id="zh-cn_topic_0000001149807881_row1113125710483"><td class="cellrowborder" valign="top" width="17.599999999999998%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p1421211251605"><a name="zh-cn_topic_0000001149807881_p1421211251605"></a><a name="zh-cn_topic_0000001149807881_p1421211251605"></a>key</p> 1295</td> 1296<td class="cellrowborder" valign="top" width="19.49%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p15212725503"><a name="zh-cn_topic_0000001149807881_p15212725503"></a><a name="zh-cn_topic_0000001149807881_p15212725503"></a>string</p> 1297</td> 1298<td class="cellrowborder" valign="top" width="9.78%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p52122259012"><a name="zh-cn_topic_0000001149807881_p52122259012"></a><a name="zh-cn_topic_0000001149807881_p52122259012"></a>是</p> 1299</td> 1300<td class="cellrowborder" valign="top" width="53.13%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p1747016545595"><a name="zh-cn_topic_0000001149807881_p1747016545595"></a><a name="zh-cn_topic_0000001149807881_p1747016545595"></a>被设置的音频参数的键。</p> 1301</td> 1302</tr> 1303<tr id="zh-cn_topic_0000001149807881_row914185716488"><td class="cellrowborder" valign="top" width="17.599999999999998%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p1931324215016"><a name="zh-cn_topic_0000001149807881_p1931324215016"></a><a name="zh-cn_topic_0000001149807881_p1931324215016"></a>value</p> 1304</td> 1305<td class="cellrowborder" valign="top" width="19.49%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p9313164219015"><a name="zh-cn_topic_0000001149807881_p9313164219015"></a><a name="zh-cn_topic_0000001149807881_p9313164219015"></a>string</p> 1306</td> 1307<td class="cellrowborder" valign="top" width="9.78%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p931316429017"><a name="zh-cn_topic_0000001149807881_p931316429017"></a><a name="zh-cn_topic_0000001149807881_p931316429017"></a>是</p> 1308</td> 1309<td class="cellrowborder" valign="top" width="53.13%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p1231310421203"><a name="zh-cn_topic_0000001149807881_p1231310421203"></a><a name="zh-cn_topic_0000001149807881_p1231310421203"></a>被设置的音频参数的值。</p> 1310</td> 1311</tr> 1312</tbody> 1313</table> 1314 1315**返回值:** 1316 1317<a name="zh-cn_topic_0000001149807881_table1514135774811"></a> 1318<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row16141857164818"><th class="cellrowborder" valign="top" width="26.06%" id="mcps1.1.3.1.1"><p id="zh-cn_topic_0000001149807881_p1847161019561"><a name="zh-cn_topic_0000001149807881_p1847161019561"></a><a name="zh-cn_topic_0000001149807881_p1847161019561"></a>类型</p> 1319</th> 1320<th class="cellrowborder" valign="top" width="73.94%" id="mcps1.1.3.1.2"><p id="zh-cn_topic_0000001149807881_p7847161018562"><a name="zh-cn_topic_0000001149807881_p7847161018562"></a><a name="zh-cn_topic_0000001149807881_p7847161018562"></a>说明</p> 1321</th> 1322</tr> 1323</thead> 1324<tbody><tr id="zh-cn_topic_0000001149807881_row1815185711489"><td class="cellrowborder" valign="top" width="26.06%" headers="mcps1.1.3.1.1 "><p id="zh-cn_topic_0000001149807881_p8151957184816"><a name="zh-cn_topic_0000001149807881_p8151957184816"></a><a name="zh-cn_topic_0000001149807881_p8151957184816"></a>Promise<void></p> 1325</td> 1326<td class="cellrowborder" valign="top" width="73.94%" headers="mcps1.1.3.1.2 "><p id="zh-cn_topic_0000001149807881_p41511577486"><a name="zh-cn_topic_0000001149807881_p41511577486"></a><a name="zh-cn_topic_0000001149807881_p41511577486"></a>Promise回调返回设置成功或失败。</p> 1327</td> 1328</tr> 1329</tbody> 1330</table> 1331 1332**示例:** 1333 1334``` 1335audioManager.setAudioParameter('PBits per sample', '8 bit').then(() => 1336 console.log('Promise returned to indicate a successful setting of the audio parameter.'); 1337) 1338``` 1339 1340### getAudioParameter\(key: string, callback: AsyncCallback<string\>\): void<sup>7+</sup><a name="zh-cn_topic_0000001149807881_section1415145714812"></a> 1341 1342获取指定音频参数值,使用callback方式返回异步结果。 1343 1344**参数:** 1345 1346<a name="zh-cn_topic_0000001149807881_table1315657114817"></a> 1347<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row181517574489"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p1023712411572"><a name="zh-cn_topic_0000001149807881_p1023712411572"></a><a name="zh-cn_topic_0000001149807881_p1023712411572"></a>参数名</p> 1348</th> 1349<th class="cellrowborder" valign="top" width="19.52%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p16238124125713"><a name="zh-cn_topic_0000001149807881_p16238124125713"></a><a name="zh-cn_topic_0000001149807881_p16238124125713"></a>类型</p> 1350</th> 1351<th class="cellrowborder" valign="top" width="9.17%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p1623811419574"><a name="zh-cn_topic_0000001149807881_p1623811419574"></a><a name="zh-cn_topic_0000001149807881_p1623811419574"></a>必填</p> 1352</th> 1353<th class="cellrowborder" valign="top" width="53.74%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p82387411579"><a name="zh-cn_topic_0000001149807881_p82387411579"></a><a name="zh-cn_topic_0000001149807881_p82387411579"></a>说明</p> 1354</th> 1355</tr> 1356</thead> 1357<tbody><tr id="zh-cn_topic_0000001149807881_row616115754814"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p5220105915810"><a name="zh-cn_topic_0000001149807881_p5220105915810"></a><a name="zh-cn_topic_0000001149807881_p5220105915810"></a>key</p> 1358</td> 1359<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p1722019593812"><a name="zh-cn_topic_0000001149807881_p1722019593812"></a><a name="zh-cn_topic_0000001149807881_p1722019593812"></a>string</p> 1360</td> 1361<td class="cellrowborder" valign="top" width="9.17%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p82209596816"><a name="zh-cn_topic_0000001149807881_p82209596816"></a><a name="zh-cn_topic_0000001149807881_p82209596816"></a>是</p> 1362</td> 1363<td class="cellrowborder" valign="top" width="53.74%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p11261642604"><a name="zh-cn_topic_0000001149807881_p11261642604"></a><a name="zh-cn_topic_0000001149807881_p11261642604"></a>待获取的音频参数的键。</p> 1364</td> 1365</tr> 1366<tr id="zh-cn_topic_0000001149807881_row61715714487"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p1517145710486"><a name="zh-cn_topic_0000001149807881_p1517145710486"></a><a name="zh-cn_topic_0000001149807881_p1517145710486"></a>callback</p> 1367</td> 1368<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p141715713486"><a name="zh-cn_topic_0000001149807881_p141715713486"></a><a name="zh-cn_topic_0000001149807881_p141715713486"></a>AsyncCallback<string></p> 1369</td> 1370<td class="cellrowborder" valign="top" width="9.17%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p21785718487"><a name="zh-cn_topic_0000001149807881_p21785718487"></a><a name="zh-cn_topic_0000001149807881_p21785718487"></a>是</p> 1371</td> 1372<td class="cellrowborder" valign="top" width="53.74%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p91715719485"><a name="zh-cn_topic_0000001149807881_p91715719485"></a><a name="zh-cn_topic_0000001149807881_p91715719485"></a>回调返回获取的音频参数的值。</p> 1373</td> 1374</tr> 1375</tbody> 1376</table> 1377 1378**返回值:** 1379 1380无 1381 1382**示例:** 1383 1384``` 1385audioManager.getAudioParameter('PBits per sample', (err, value) => { 1386 if (err) { 1387 console.error('Failed to obtain the value of the audio parameter. ${err.message}'); 1388 return; 1389 } 1390 console.log('Callback invoked to indicate that the value of the audio parameter is obtained.' + value); 1391}) 1392``` 1393 1394### getAudioParameter\(key: string\): Promise<string\><sup>7+</sup><a name="zh-cn_topic_0000001149807881_section3185577485"></a> 1395 1396获取指定音频参数值,使用promise方式返回异步结果。 1397 1398**参数:** 1399 1400<a name="zh-cn_topic_0000001149807881_table5180572488"></a> 1401<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row111885714815"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p51148120574"><a name="zh-cn_topic_0000001149807881_p51148120574"></a><a name="zh-cn_topic_0000001149807881_p51148120574"></a>参数名</p> 1402</th> 1403<th class="cellrowborder" valign="top" width="19.52%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p111142175720"><a name="zh-cn_topic_0000001149807881_p111142175720"></a><a name="zh-cn_topic_0000001149807881_p111142175720"></a>类型</p> 1404</th> 1405<th class="cellrowborder" valign="top" width="9.42%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p151141145717"><a name="zh-cn_topic_0000001149807881_p151141145717"></a><a name="zh-cn_topic_0000001149807881_p151141145717"></a>必填</p> 1406</th> 1407<th class="cellrowborder" valign="top" width="53.49%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p1111410195711"><a name="zh-cn_topic_0000001149807881_p1111410195711"></a><a name="zh-cn_topic_0000001149807881_p1111410195711"></a>说明</p> 1408</th> 1409</tr> 1410</thead> 1411<tbody><tr id="zh-cn_topic_0000001149807881_row1519105784811"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p7988114714123"><a name="zh-cn_topic_0000001149807881_p7988114714123"></a><a name="zh-cn_topic_0000001149807881_p7988114714123"></a>key</p> 1412</td> 1413<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p149881947161218"><a name="zh-cn_topic_0000001149807881_p149881947161218"></a><a name="zh-cn_topic_0000001149807881_p149881947161218"></a>string</p> 1414</td> 1415<td class="cellrowborder" valign="top" width="9.42%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p1798812477124"><a name="zh-cn_topic_0000001149807881_p1798812477124"></a><a name="zh-cn_topic_0000001149807881_p1798812477124"></a>是</p> 1416</td> 1417<td class="cellrowborder" valign="top" width="53.49%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p1860910215116"><a name="zh-cn_topic_0000001149807881_p1860910215116"></a><a name="zh-cn_topic_0000001149807881_p1860910215116"></a>待获取的音频参数的键。</p> 1418</td> 1419</tr> 1420</tbody> 1421</table> 1422 1423**返回值:** 1424 1425<a name="zh-cn_topic_0000001149807881_table152065754818"></a> 1426<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row10201357184813"><th class="cellrowborder" valign="top" width="25.97%" id="mcps1.1.3.1.1"><p id="zh-cn_topic_0000001149807881_p11727422165616"><a name="zh-cn_topic_0000001149807881_p11727422165616"></a><a name="zh-cn_topic_0000001149807881_p11727422165616"></a>类型</p> 1427</th> 1428<th class="cellrowborder" valign="top" width="74.03%" id="mcps1.1.3.1.2"><p id="zh-cn_topic_0000001149807881_p5727922155611"><a name="zh-cn_topic_0000001149807881_p5727922155611"></a><a name="zh-cn_topic_0000001149807881_p5727922155611"></a>说明</p> 1429</th> 1430</tr> 1431</thead> 1432<tbody><tr id="zh-cn_topic_0000001149807881_row8207572485"><td class="cellrowborder" valign="top" width="25.97%" headers="mcps1.1.3.1.1 "><p id="zh-cn_topic_0000001149807881_p22155774819"><a name="zh-cn_topic_0000001149807881_p22155774819"></a><a name="zh-cn_topic_0000001149807881_p22155774819"></a>Promise<string></p> 1433</td> 1434<td class="cellrowborder" valign="top" width="74.03%" headers="mcps1.1.3.1.2 "><p id="zh-cn_topic_0000001149807881_p1121155704810"><a name="zh-cn_topic_0000001149807881_p1121155704810"></a><a name="zh-cn_topic_0000001149807881_p1121155704810"></a>Promise回调返回获取的音频参数的值。</p> 1435</td> 1436</tr> 1437</tbody> 1438</table> 1439 1440**示例:** 1441 1442``` 1443audioManager.getAudioParameter('PBits per sample').then((value) => 1444 console.log('Promise returned to indicate that the value of the audio parameter is obtained.' + value); 1445) 1446``` 1447 1448### getDevices\(deviceFlag: DeviceFlag, callback: AsyncCallback<AudioDeviceDescriptors\>\): void<a name="zh-cn_topic_0000001149807881_section11536182020523"></a> 1449 1450获取音频设备列表,使用callback方式返回异步结果。 1451 1452**参数:** 1453 1454<a name="zh-cn_topic_0000001149807881_table8653191616249"></a> 1455<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row165412169245"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p1665412161243"><a name="zh-cn_topic_0000001149807881_p1665412161243"></a><a name="zh-cn_topic_0000001149807881_p1665412161243"></a>参数名</p> 1456</th> 1457<th class="cellrowborder" valign="top" width="21%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p1765491672417"><a name="zh-cn_topic_0000001149807881_p1765491672417"></a><a name="zh-cn_topic_0000001149807881_p1765491672417"></a>类型</p> 1458</th> 1459<th class="cellrowborder" valign="top" width="12.78%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p113067111209"><a name="zh-cn_topic_0000001149807881_p113067111209"></a><a name="zh-cn_topic_0000001149807881_p113067111209"></a>必填</p> 1460</th> 1461<th class="cellrowborder" valign="top" width="48.65%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p765431682419"><a name="zh-cn_topic_0000001149807881_p765431682419"></a><a name="zh-cn_topic_0000001149807881_p765431682419"></a>说明</p> 1462</th> 1463</tr> 1464</thead> 1465<tbody><tr id="zh-cn_topic_0000001149807881_row1654191652419"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p126549165241"><a name="zh-cn_topic_0000001149807881_p126549165241"></a><a name="zh-cn_topic_0000001149807881_p126549165241"></a>deviceFlag</p> 1466</td> 1467<td class="cellrowborder" valign="top" width="21%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p8654141622416"><a name="zh-cn_topic_0000001149807881_p8654141622416"></a><a name="zh-cn_topic_0000001149807881_p8654141622416"></a><a href="#zh-cn_topic_0000001149807881_section11285183164210">DeviceFlag</a></p> 1468</td> 1469<td class="cellrowborder" valign="top" width="12.78%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p830651111019"><a name="zh-cn_topic_0000001149807881_p830651111019"></a><a name="zh-cn_topic_0000001149807881_p830651111019"></a>是</p> 1470</td> 1471<td class="cellrowborder" valign="top" width="48.65%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p10654131616248"><a name="zh-cn_topic_0000001149807881_p10654131616248"></a><a name="zh-cn_topic_0000001149807881_p10654131616248"></a>设备类型的flag。</p> 1472</td> 1473</tr> 1474<tr id="zh-cn_topic_0000001149807881_row16544162243"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p176541316122412"><a name="zh-cn_topic_0000001149807881_p176541316122412"></a><a name="zh-cn_topic_0000001149807881_p176541316122412"></a>callback</p> 1475</td> 1476<td class="cellrowborder" valign="top" width="21%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p1565461620244"><a name="zh-cn_topic_0000001149807881_p1565461620244"></a><a name="zh-cn_topic_0000001149807881_p1565461620244"></a>AsyncCallback<<a href="#zh-cn_topic_0000001149807881_section5181155710523">AudioDeviceDescriptors</a>></p> 1477</td> 1478<td class="cellrowborder" valign="top" width="12.78%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p2307711908"><a name="zh-cn_topic_0000001149807881_p2307711908"></a><a name="zh-cn_topic_0000001149807881_p2307711908"></a>是</p> 1479</td> 1480<td class="cellrowborder" valign="top" width="48.65%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p19654141672416"><a name="zh-cn_topic_0000001149807881_p19654141672416"></a><a name="zh-cn_topic_0000001149807881_p19654141672416"></a>回调,返回设备列表。</p> 1481</td> 1482</tr> 1483</tbody> 1484</table> 1485 1486**返回值:** 1487 1488无 1489 1490**示例:** 1491 1492``` 1493audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG, (err, value)=>{ 1494 if (err) { 1495 console.error('Failed to obtain the device list. ${err.message}'); 1496 return; 1497 } 1498 console.log('Callback invoked to indicate that the device list is obtained.'); 1499}) 1500``` 1501 1502### getDevices\(deviceFlag: DeviceFlag\): Promise<AudioDeviceDescriptors\><a name="zh-cn_topic_0000001149807881_section181733125210"></a> 1503 1504获取音频设备列表,使用promise方式返回异步结果。 1505 1506**参数:** 1507 1508<a name="zh-cn_topic_0000001149807881_table17655516132411"></a> 1509<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row4655616192414"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p1465518164247"><a name="zh-cn_topic_0000001149807881_p1465518164247"></a><a name="zh-cn_topic_0000001149807881_p1465518164247"></a>参数名</p> 1510</th> 1511<th class="cellrowborder" valign="top" width="19.52%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p196551316172415"><a name="zh-cn_topic_0000001149807881_p196551316172415"></a><a name="zh-cn_topic_0000001149807881_p196551316172415"></a>类型</p> 1512</th> 1513<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p13161629902"><a name="zh-cn_topic_0000001149807881_p13161629902"></a><a name="zh-cn_topic_0000001149807881_p13161629902"></a>必填</p> 1514</th> 1515<th class="cellrowborder" valign="top" width="55.38999999999999%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p17655616102417"><a name="zh-cn_topic_0000001149807881_p17655616102417"></a><a name="zh-cn_topic_0000001149807881_p17655616102417"></a>说明</p> 1516</th> 1517</tr> 1518</thead> 1519<tbody><tr id="zh-cn_topic_0000001149807881_row13656111662415"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p2092935211270"><a name="zh-cn_topic_0000001149807881_p2092935211270"></a><a name="zh-cn_topic_0000001149807881_p2092935211270"></a>deviceFlag</p> 1520</td> 1521<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p88719299489"><a name="zh-cn_topic_0000001149807881_p88719299489"></a><a name="zh-cn_topic_0000001149807881_p88719299489"></a><a href="#zh-cn_topic_0000001149807881_section11285183164210">DeviceFlag</a></p> 1522</td> 1523<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p12161129209"><a name="zh-cn_topic_0000001149807881_p12161129209"></a><a name="zh-cn_topic_0000001149807881_p12161129209"></a>是</p> 1524</td> 1525<td class="cellrowborder" valign="top" width="55.38999999999999%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p1692985222710"><a name="zh-cn_topic_0000001149807881_p1692985222710"></a><a name="zh-cn_topic_0000001149807881_p1692985222710"></a>设备类型的flag。</p> 1526</td> 1527</tr> 1528</tbody> 1529</table> 1530 1531**返回值:** 1532 1533<a name="zh-cn_topic_0000001149807881_table565618166249"></a> 1534<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row19656151662410"><th class="cellrowborder" valign="top" width="26.02%" id="mcps1.1.3.1.1"><p id="zh-cn_topic_0000001149807881_p15656916152415"><a name="zh-cn_topic_0000001149807881_p15656916152415"></a><a name="zh-cn_topic_0000001149807881_p15656916152415"></a>类型</p> 1535</th> 1536<th class="cellrowborder" valign="top" width="73.98%" id="mcps1.1.3.1.2"><p id="zh-cn_topic_0000001149807881_p365641616247"><a name="zh-cn_topic_0000001149807881_p365641616247"></a><a name="zh-cn_topic_0000001149807881_p365641616247"></a>说明</p> 1537</th> 1538</tr> 1539</thead> 1540<tbody><tr id="zh-cn_topic_0000001149807881_row665681617243"><td class="cellrowborder" valign="top" width="26.02%" headers="mcps1.1.3.1.1 "><p id="zh-cn_topic_0000001149807881_p5673192162816"><a name="zh-cn_topic_0000001149807881_p5673192162816"></a><a name="zh-cn_topic_0000001149807881_p5673192162816"></a>Promise<<a href="#zh-cn_topic_0000001149807881_section5181155710523">AudioDeviceDescriptors</a>></p> 1541</td> 1542<td class="cellrowborder" valign="top" width="73.98%" headers="mcps1.1.3.1.2 "><p id="zh-cn_topic_0000001149807881_p765751610249"><a name="zh-cn_topic_0000001149807881_p765751610249"></a><a name="zh-cn_topic_0000001149807881_p765751610249"></a>Promise回调返回设备列表。</p> 1543</td> 1544</tr> 1545</tbody> 1546</table> 1547 1548**示例:** 1549 1550``` 1551audioManager.getDevices(audio.DeviceFlag.OUTPUT_DEVICES_FLAG).then((data)=> 1552 console.log('Promise returned to indicate that the device list is obtained.'); 1553) 1554``` 1555 1556### setDeviceActive\(deviceType: DeviceType, active: boolean, callback: AsyncCallback<void\>\): void<sup>7+</sup><a name="zh-cn_topic_0000001149807881_section103558400222"></a> 1557 1558设置设备激活状态,使用callback方式返回异步结果。 1559 1560**参数:** 1561 1562<a name="zh-cn_topic_0000001149807881_table5355740142213"></a> 1563<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row133561640192217"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p41511817185812"><a name="zh-cn_topic_0000001149807881_p41511817185812"></a><a name="zh-cn_topic_0000001149807881_p41511817185812"></a>参数名</p> 1564</th> 1565<th class="cellrowborder" valign="top" width="19.52%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p1415119175583"><a name="zh-cn_topic_0000001149807881_p1415119175583"></a><a name="zh-cn_topic_0000001149807881_p1415119175583"></a>类型</p> 1566</th> 1567<th class="cellrowborder" valign="top" width="9.78%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p16151171720587"><a name="zh-cn_topic_0000001149807881_p16151171720587"></a><a name="zh-cn_topic_0000001149807881_p16151171720587"></a>必填</p> 1568</th> 1569<th class="cellrowborder" valign="top" width="53.13%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p141511117195811"><a name="zh-cn_topic_0000001149807881_p141511117195811"></a><a name="zh-cn_topic_0000001149807881_p141511117195811"></a>说明</p> 1570</th> 1571</tr> 1572</thead> 1573<tbody><tr id="zh-cn_topic_0000001149807881_row15356174052213"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p6356240182212"><a name="zh-cn_topic_0000001149807881_p6356240182212"></a><a name="zh-cn_topic_0000001149807881_p6356240182212"></a>deviceType</p> 1574</td> 1575<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p1982716244344"><a name="zh-cn_topic_0000001149807881_p1982716244344"></a><a name="zh-cn_topic_0000001149807881_p1982716244344"></a><a href="#zh-cn_topic_0000001149807881_section11727420122710">DeviceType</a></p> 1576</td> 1577<td class="cellrowborder" valign="top" width="9.78%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p035794062216"><a name="zh-cn_topic_0000001149807881_p035794062216"></a><a name="zh-cn_topic_0000001149807881_p035794062216"></a>是</p> 1578</td> 1579<td class="cellrowborder" valign="top" width="53.13%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p166271345204414"><a name="zh-cn_topic_0000001149807881_p166271345204414"></a><a name="zh-cn_topic_0000001149807881_p166271345204414"></a>音频设备类型。</p> 1580</td> 1581</tr> 1582<tr id="zh-cn_topic_0000001149807881_row1635713409226"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p268924403311"><a name="zh-cn_topic_0000001149807881_p268924403311"></a><a name="zh-cn_topic_0000001149807881_p268924403311"></a>active</p> 1583</td> 1584<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p5357104032210"><a name="zh-cn_topic_0000001149807881_p5357104032210"></a><a name="zh-cn_topic_0000001149807881_p5357104032210"></a>boolean</p> 1585</td> 1586<td class="cellrowborder" valign="top" width="9.78%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p635764012218"><a name="zh-cn_topic_0000001149807881_p635764012218"></a><a name="zh-cn_topic_0000001149807881_p635764012218"></a>是</p> 1587</td> 1588<td class="cellrowborder" valign="top" width="53.13%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p1357124052217"><a name="zh-cn_topic_0000001149807881_p1357124052217"></a><a name="zh-cn_topic_0000001149807881_p1357124052217"></a>设备激活状态。</p> 1589</td> 1590</tr> 1591<tr id="zh-cn_topic_0000001149807881_row133581840102212"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p03581340182212"><a name="zh-cn_topic_0000001149807881_p03581340182212"></a><a name="zh-cn_topic_0000001149807881_p03581340182212"></a>callback</p> 1592</td> 1593<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p3358204011223"><a name="zh-cn_topic_0000001149807881_p3358204011223"></a><a name="zh-cn_topic_0000001149807881_p3358204011223"></a>AsyncCallback<void></p> 1594</td> 1595<td class="cellrowborder" valign="top" width="9.78%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p10358124014222"><a name="zh-cn_topic_0000001149807881_p10358124014222"></a><a name="zh-cn_topic_0000001149807881_p10358124014222"></a>是</p> 1596</td> 1597<td class="cellrowborder" valign="top" width="53.13%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p13358540132217"><a name="zh-cn_topic_0000001149807881_p13358540132217"></a><a name="zh-cn_topic_0000001149807881_p13358540132217"></a>回调返回设置成功或失败。</p> 1598</td> 1599</tr> 1600</tbody> 1601</table> 1602 1603**返回值:** 1604 1605无 1606 1607**示例:** 1608 1609``` 1610audioManager.setDeviceActive(audio.DeviceType.SPEAKER, true, (err)=> { 1611 if (err) { 1612 console.error('Failed to set the active status of the device. ${err.message}'); 1613 return; 1614 } 1615 console.log('Callback invoked to indicate that the device is set to the active status.'); 1616}) 1617``` 1618 1619### setDeviceActive\(deviceType: DeviceType, active: boolean\): Promise<void\><sup>7+</sup><a name="zh-cn_topic_0000001149807881_section1235914401228"></a> 1620 1621设置设备激活状态,使用promise方式返回异步结果。 1622 1623**参数:** 1624 1625<a name="zh-cn_topic_0000001149807881_table1335914018225"></a> 1626<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row103598403228"><th class="cellrowborder" valign="top" width="17.599999999999998%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p5120161465816"><a name="zh-cn_topic_0000001149807881_p5120161465816"></a><a name="zh-cn_topic_0000001149807881_p5120161465816"></a>参数名</p> 1627</th> 1628<th class="cellrowborder" valign="top" width="19.49%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p6120121420586"><a name="zh-cn_topic_0000001149807881_p6120121420586"></a><a name="zh-cn_topic_0000001149807881_p6120121420586"></a>类型</p> 1629</th> 1630<th class="cellrowborder" valign="top" width="7.5200000000000005%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p412015148583"><a name="zh-cn_topic_0000001149807881_p412015148583"></a><a name="zh-cn_topic_0000001149807881_p412015148583"></a>必填</p> 1631</th> 1632<th class="cellrowborder" valign="top" width="55.38999999999999%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p14120111417585"><a name="zh-cn_topic_0000001149807881_p14120111417585"></a><a name="zh-cn_topic_0000001149807881_p14120111417585"></a>说明</p> 1633</th> 1634</tr> 1635</thead> 1636<tbody><tr id="zh-cn_topic_0000001149807881_row6360124010225"><td class="cellrowborder" valign="top" width="17.599999999999998%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p21049584484"><a name="zh-cn_topic_0000001149807881_p21049584484"></a><a name="zh-cn_topic_0000001149807881_p21049584484"></a>deviceType</p> 1637</td> 1638<td class="cellrowborder" valign="top" width="19.49%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p98241474910"><a name="zh-cn_topic_0000001149807881_p98241474910"></a><a name="zh-cn_topic_0000001149807881_p98241474910"></a><a href="#zh-cn_topic_0000001149807881_section11727420122710">DeviceType</a></p> 1639</td> 1640<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p103601240202216"><a name="zh-cn_topic_0000001149807881_p103601240202216"></a><a name="zh-cn_topic_0000001149807881_p103601240202216"></a>是</p> 1641</td> 1642<td class="cellrowborder" valign="top" width="55.38999999999999%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p173618402226"><a name="zh-cn_topic_0000001149807881_p173618402226"></a><a name="zh-cn_topic_0000001149807881_p173618402226"></a>音频设备类型。</p> 1643</td> 1644</tr> 1645<tr id="zh-cn_topic_0000001149807881_row10361104018222"><td class="cellrowborder" valign="top" width="17.599999999999998%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p280718578504"><a name="zh-cn_topic_0000001149807881_p280718578504"></a><a name="zh-cn_topic_0000001149807881_p280718578504"></a>active</p> 1646</td> 1647<td class="cellrowborder" valign="top" width="19.49%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p103615400229"><a name="zh-cn_topic_0000001149807881_p103615400229"></a><a name="zh-cn_topic_0000001149807881_p103615400229"></a>boolean</p> 1648</td> 1649<td class="cellrowborder" valign="top" width="7.5200000000000005%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p936154082210"><a name="zh-cn_topic_0000001149807881_p936154082210"></a><a name="zh-cn_topic_0000001149807881_p936154082210"></a>是</p> 1650</td> 1651<td class="cellrowborder" valign="top" width="55.38999999999999%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p280510397459"><a name="zh-cn_topic_0000001149807881_p280510397459"></a><a name="zh-cn_topic_0000001149807881_p280510397459"></a>设备激活状态。</p> 1652</td> 1653</tr> 1654</tbody> 1655</table> 1656 1657**返回值:** 1658 1659<a name="zh-cn_topic_0000001149807881_table636154016223"></a> 1660<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row17362540112218"><th class="cellrowborder" valign="top" width="26.06%" id="mcps1.1.3.1.1"><p id="zh-cn_topic_0000001149807881_p78801632195618"><a name="zh-cn_topic_0000001149807881_p78801632195618"></a><a name="zh-cn_topic_0000001149807881_p78801632195618"></a>类型</p> 1661</th> 1662<th class="cellrowborder" valign="top" width="73.94%" id="mcps1.1.3.1.2"><p id="zh-cn_topic_0000001149807881_p1688043265614"><a name="zh-cn_topic_0000001149807881_p1688043265614"></a><a name="zh-cn_topic_0000001149807881_p1688043265614"></a>说明</p> 1663</th> 1664</tr> 1665</thead> 1666<tbody><tr id="zh-cn_topic_0000001149807881_row143621940142213"><td class="cellrowborder" valign="top" width="26.06%" headers="mcps1.1.3.1.1 "><p id="zh-cn_topic_0000001149807881_p236215405225"><a name="zh-cn_topic_0000001149807881_p236215405225"></a><a name="zh-cn_topic_0000001149807881_p236215405225"></a>Promise<void></p> 1667</td> 1668<td class="cellrowborder" valign="top" width="73.94%" headers="mcps1.1.3.1.2 "><p id="zh-cn_topic_0000001149807881_p536214032220"><a name="zh-cn_topic_0000001149807881_p536214032220"></a><a name="zh-cn_topic_0000001149807881_p536214032220"></a>Promise回调返回设置成功或失败。</p> 1669</td> 1670</tr> 1671</tbody> 1672</table> 1673 1674**示例:** 1675 1676``` 1677audioManager.setDeviceActive(audio.DeviceType.SPEAKER, true).then(()=> 1678 console.log('Promise returned to indicate that the device is set to the active status.'); 1679) 1680``` 1681 1682### isDeviceActive\(deviceType: DeviceType, callback: AsyncCallback<boolean\>\): void<sup>7+</sup><a name="zh-cn_topic_0000001149807881_section12363240122219"></a> 1683 1684获取指定设备激活状态,使用callback方式返回异步结果。 1685 1686**参数:** 1687 1688<a name="zh-cn_topic_0000001149807881_table13638406221"></a> 1689<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row15363840122216"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p18980131114586"><a name="zh-cn_topic_0000001149807881_p18980131114586"></a><a name="zh-cn_topic_0000001149807881_p18980131114586"></a>参数名</p> 1690</th> 1691<th class="cellrowborder" valign="top" width="19.52%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p16980161145817"><a name="zh-cn_topic_0000001149807881_p16980161145817"></a><a name="zh-cn_topic_0000001149807881_p16980161145817"></a>类型</p> 1692</th> 1693<th class="cellrowborder" valign="top" width="9.25%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p5980121165813"><a name="zh-cn_topic_0000001149807881_p5980121165813"></a><a name="zh-cn_topic_0000001149807881_p5980121165813"></a>必填</p> 1694</th> 1695<th class="cellrowborder" valign="top" width="53.66%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p149802111588"><a name="zh-cn_topic_0000001149807881_p149802111588"></a><a name="zh-cn_topic_0000001149807881_p149802111588"></a>说明</p> 1696</th> 1697</tr> 1698</thead> 1699<tbody><tr id="zh-cn_topic_0000001149807881_row1536417409223"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p12364174016224"><a name="zh-cn_topic_0000001149807881_p12364174016224"></a><a name="zh-cn_topic_0000001149807881_p12364174016224"></a>deviceType</p> 1700</td> 1701<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p1779218497578"><a name="zh-cn_topic_0000001149807881_p1779218497578"></a><a name="zh-cn_topic_0000001149807881_p1779218497578"></a><a href="#zh-cn_topic_0000001149807881_section11727420122710">DeviceType</a></p> 1702</td> 1703<td class="cellrowborder" valign="top" width="9.25%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p122111521127"><a name="zh-cn_topic_0000001149807881_p122111521127"></a><a name="zh-cn_topic_0000001149807881_p122111521127"></a>是</p> 1704</td> 1705<td class="cellrowborder" valign="top" width="53.66%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p4364640122219"><a name="zh-cn_topic_0000001149807881_p4364640122219"></a><a name="zh-cn_topic_0000001149807881_p4364640122219"></a>音频设备类型。</p> 1706</td> 1707</tr> 1708<tr id="zh-cn_topic_0000001149807881_row11365174011226"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p14365144016225"><a name="zh-cn_topic_0000001149807881_p14365144016225"></a><a name="zh-cn_topic_0000001149807881_p14365144016225"></a>callback</p> 1709</td> 1710<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p15365104062213"><a name="zh-cn_topic_0000001149807881_p15365104062213"></a><a name="zh-cn_topic_0000001149807881_p15365104062213"></a>AsyncCallback<boolean></p> 1711</td> 1712<td class="cellrowborder" valign="top" width="9.25%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p20365154014220"><a name="zh-cn_topic_0000001149807881_p20365154014220"></a><a name="zh-cn_topic_0000001149807881_p20365154014220"></a>是</p> 1713</td> 1714<td class="cellrowborder" valign="top" width="53.66%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p19365154072213"><a name="zh-cn_topic_0000001149807881_p19365154072213"></a><a name="zh-cn_topic_0000001149807881_p19365154072213"></a>回调返回设备的激活状态。</p> 1715</td> 1716</tr> 1717</tbody> 1718</table> 1719 1720**返回值:** 1721 1722无 1723 1724**示例:** 1725 1726``` 1727audioManager.isDeviceActive(audio.DeviceType.SPEAKER, (err, value) => { 1728 if (err) { 1729 console.error('Failed to obtain the active status of the device. ${err.message}'); 1730 return; 1731 } 1732 console.log('Callback invoked to indicate that the active status of the device is obtained.'); 1733}) 1734``` 1735 1736### isDeviceActive\(deviceType: DeviceType\): Promise<boolean\><sup>7+</sup><a name="zh-cn_topic_0000001149807881_section18366184012213"></a> 1737 1738获取指定设备激活状态,使用promise方式返回异步结果。 1739 1740**参数:** 1741 1742<a name="zh-cn_topic_0000001149807881_table10366184019222"></a> 1743<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row3366174012217"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p158645818582"><a name="zh-cn_topic_0000001149807881_p158645818582"></a><a name="zh-cn_topic_0000001149807881_p158645818582"></a>参数名</p> 1744</th> 1745<th class="cellrowborder" valign="top" width="19.52%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p15864158125814"><a name="zh-cn_topic_0000001149807881_p15864158125814"></a><a name="zh-cn_topic_0000001149807881_p15864158125814"></a>类型</p> 1746</th> 1747<th class="cellrowborder" valign="top" width="8.99%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p168649845815"><a name="zh-cn_topic_0000001149807881_p168649845815"></a><a name="zh-cn_topic_0000001149807881_p168649845815"></a>必填</p> 1748</th> 1749<th class="cellrowborder" valign="top" width="53.92%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p2086413855815"><a name="zh-cn_topic_0000001149807881_p2086413855815"></a><a name="zh-cn_topic_0000001149807881_p2086413855815"></a>说明</p> 1750</th> 1751</tr> 1752</thead> 1753<tbody><tr id="zh-cn_topic_0000001149807881_row12367340122213"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p11637137420"><a name="zh-cn_topic_0000001149807881_p11637137420"></a><a name="zh-cn_topic_0000001149807881_p11637137420"></a>deviceType</p> 1754</td> 1755<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p1616311136412"><a name="zh-cn_topic_0000001149807881_p1616311136412"></a><a name="zh-cn_topic_0000001149807881_p1616311136412"></a><a href="#zh-cn_topic_0000001149807881_section11727420122710">DeviceType</a></p> 1756</td> 1757<td class="cellrowborder" valign="top" width="8.99%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p201646138419"><a name="zh-cn_topic_0000001149807881_p201646138419"></a><a name="zh-cn_topic_0000001149807881_p201646138419"></a>是</p> 1758</td> 1759<td class="cellrowborder" valign="top" width="53.92%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p7164113246"><a name="zh-cn_topic_0000001149807881_p7164113246"></a><a name="zh-cn_topic_0000001149807881_p7164113246"></a>音频设备类型。</p> 1760</td> 1761</tr> 1762</tbody> 1763</table> 1764 1765**返回值:** 1766 1767<a name="zh-cn_topic_0000001149807881_table1368174012225"></a> 1768<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row17368164018220"><th class="cellrowborder" valign="top" width="25.97%" id="mcps1.1.3.1.1"><p id="zh-cn_topic_0000001149807881_p16368154062213"><a name="zh-cn_topic_0000001149807881_p16368154062213"></a><a name="zh-cn_topic_0000001149807881_p16368154062213"></a>Type</p> 1769</th> 1770<th class="cellrowborder" valign="top" width="74.03%" id="mcps1.1.3.1.2"><p id="zh-cn_topic_0000001149807881_p1368740102218"><a name="zh-cn_topic_0000001149807881_p1368740102218"></a><a name="zh-cn_topic_0000001149807881_p1368740102218"></a>Description</p> 1771</th> 1772</tr> 1773</thead> 1774<tbody><tr id="zh-cn_topic_0000001149807881_row8368840162213"><td class="cellrowborder" valign="top" width="25.97%" headers="mcps1.1.3.1.1 "><p id="zh-cn_topic_0000001149807881_p1436944092212"><a name="zh-cn_topic_0000001149807881_p1436944092212"></a><a name="zh-cn_topic_0000001149807881_p1436944092212"></a>Promise<boolean></p> 1775</td> 1776<td class="cellrowborder" valign="top" width="74.03%" headers="mcps1.1.3.1.2 "><p id="zh-cn_topic_0000001149807881_p113691340122217"><a name="zh-cn_topic_0000001149807881_p113691340122217"></a><a name="zh-cn_topic_0000001149807881_p113691340122217"></a>Promise回调返回设备的激活状态。</p> 1777</td> 1778</tr> 1779</tbody> 1780</table> 1781 1782**示例:** 1783 1784``` 1785audioManager.isDeviceActive(audio.DeviceType.SPEAKER).then((value) => 1786 console.log('Promise returned to indicate that the active status of the device is obtained.' + value); 1787) 1788``` 1789 1790### setMicrophoneMute\(mute: boolean, callback: AsyncCallback<void\>\): void<sup>7+</sup><a name="zh-cn_topic_0000001149807881_section14703163618122"></a> 1791 1792设置麦克风静音状态,使用callback方式返回异步结果。 1793 1794**参数:** 1795 1796<a name="zh-cn_topic_0000001149807881_table6703123691210"></a> 1797<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row67041836111213"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p25751666588"><a name="zh-cn_topic_0000001149807881_p25751666588"></a><a name="zh-cn_topic_0000001149807881_p25751666588"></a>参数名</p> 1798</th> 1799<th class="cellrowborder" valign="top" width="19.52%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p12575065588"><a name="zh-cn_topic_0000001149807881_p12575065588"></a><a name="zh-cn_topic_0000001149807881_p12575065588"></a>类型</p> 1800</th> 1801<th class="cellrowborder" valign="top" width="9.6%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p3575136125814"><a name="zh-cn_topic_0000001149807881_p3575136125814"></a><a name="zh-cn_topic_0000001149807881_p3575136125814"></a>必填</p> 1802</th> 1803<th class="cellrowborder" valign="top" width="53.31%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p55751061582"><a name="zh-cn_topic_0000001149807881_p55751061582"></a><a name="zh-cn_topic_0000001149807881_p55751061582"></a>说明</p> 1804</th> 1805</tr> 1806</thead> 1807<tbody><tr id="zh-cn_topic_0000001149807881_row670420363129"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p17493113218156"><a name="zh-cn_topic_0000001149807881_p17493113218156"></a><a name="zh-cn_topic_0000001149807881_p17493113218156"></a>mute</p> 1808</td> 1809<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p519017106151"><a name="zh-cn_topic_0000001149807881_p519017106151"></a><a name="zh-cn_topic_0000001149807881_p519017106151"></a>boolean</p> 1810</td> 1811<td class="cellrowborder" valign="top" width="9.6%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p6705103681214"><a name="zh-cn_topic_0000001149807881_p6705103681214"></a><a name="zh-cn_topic_0000001149807881_p6705103681214"></a>是</p> 1812</td> 1813<td class="cellrowborder" valign="top" width="53.31%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p1953244311156"><a name="zh-cn_topic_0000001149807881_p1953244311156"></a><a name="zh-cn_topic_0000001149807881_p1953244311156"></a>待设置的静音状态,true为静音,false为非静音。</p> 1814</td> 1815</tr> 1816<tr id="zh-cn_topic_0000001149807881_row9705103671212"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p14705436191218"><a name="zh-cn_topic_0000001149807881_p14705436191218"></a><a name="zh-cn_topic_0000001149807881_p14705436191218"></a>callback</p> 1817</td> 1818<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p270593617126"><a name="zh-cn_topic_0000001149807881_p270593617126"></a><a name="zh-cn_topic_0000001149807881_p270593617126"></a>AsyncCallback<void></p> 1819</td> 1820<td class="cellrowborder" valign="top" width="9.6%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p1570573621213"><a name="zh-cn_topic_0000001149807881_p1570573621213"></a><a name="zh-cn_topic_0000001149807881_p1570573621213"></a>是</p> 1821</td> 1822<td class="cellrowborder" valign="top" width="53.31%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p19706103612122"><a name="zh-cn_topic_0000001149807881_p19706103612122"></a><a name="zh-cn_topic_0000001149807881_p19706103612122"></a>回调返回设置成功或失败。</p> 1823</td> 1824</tr> 1825</tbody> 1826</table> 1827 1828**返回值:** 1829 1830无 1831 1832**示例:** 1833 1834``` 1835audioManager.setMicrophoneMute(true, (err) => { 1836 if (err) { 1837 console.error('Failed to mute the microphone. ${err.message}'); 1838 return; 1839 } 1840 console.log('Callback invoked to indicate that the microphone is muted.'); 1841}) 1842``` 1843 1844### setMicrophoneMute\(mute: boolean\): Promise<void\><sup>7+</sup><a name="zh-cn_topic_0000001149807881_section56287111791"></a> 1845 1846设置麦克风静音状态,使用promise方式返回异步结果。 1847 1848**参数:** 1849 1850<a name="zh-cn_topic_0000001149807881_table36281411997"></a> 1851<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row16629011891"><th class="cellrowborder" valign="top" width="17.599999999999998%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p1853715297587"><a name="zh-cn_topic_0000001149807881_p1853715297587"></a><a name="zh-cn_topic_0000001149807881_p1853715297587"></a>参数名</p> 1852</th> 1853<th class="cellrowborder" valign="top" width="19.49%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p253711297583"><a name="zh-cn_topic_0000001149807881_p253711297583"></a><a name="zh-cn_topic_0000001149807881_p253711297583"></a>类型</p> 1854</th> 1855<th class="cellrowborder" valign="top" width="10.39%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p95374292585"><a name="zh-cn_topic_0000001149807881_p95374292585"></a><a name="zh-cn_topic_0000001149807881_p95374292585"></a>必填</p> 1856</th> 1857<th class="cellrowborder" valign="top" width="52.52%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p953722918583"><a name="zh-cn_topic_0000001149807881_p953722918583"></a><a name="zh-cn_topic_0000001149807881_p953722918583"></a>说明</p> 1858</th> 1859</tr> 1860</thead> 1861<tbody><tr id="zh-cn_topic_0000001149807881_row186306112918"><td class="cellrowborder" valign="top" width="17.599999999999998%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p16482185512813"><a name="zh-cn_topic_0000001149807881_p16482185512813"></a><a name="zh-cn_topic_0000001149807881_p16482185512813"></a>mute</p> 1862</td> 1863<td class="cellrowborder" valign="top" width="19.49%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p17482195572814"><a name="zh-cn_topic_0000001149807881_p17482195572814"></a><a name="zh-cn_topic_0000001149807881_p17482195572814"></a>boolean</p> 1864</td> 1865<td class="cellrowborder" valign="top" width="10.39%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p54828557284"><a name="zh-cn_topic_0000001149807881_p54828557284"></a><a name="zh-cn_topic_0000001149807881_p54828557284"></a>是</p> 1866</td> 1867<td class="cellrowborder" valign="top" width="52.52%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p5819746191515"><a name="zh-cn_topic_0000001149807881_p5819746191515"></a><a name="zh-cn_topic_0000001149807881_p5819746191515"></a>待设置的静音状态,true为静音,false为非静音。</p> 1868</td> 1869</tr> 1870</tbody> 1871</table> 1872 1873**返回值:** 1874 1875<a name="zh-cn_topic_0000001149807881_table1263113111593"></a> 1876<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row1863116111998"><th class="cellrowborder" valign="top" width="26.06%" id="mcps1.1.3.1.1"><p id="zh-cn_topic_0000001149807881_p17429547125617"><a name="zh-cn_topic_0000001149807881_p17429547125617"></a><a name="zh-cn_topic_0000001149807881_p17429547125617"></a>类型</p> 1877</th> 1878<th class="cellrowborder" valign="top" width="73.94%" id="mcps1.1.3.1.2"><p id="zh-cn_topic_0000001149807881_p15429347165616"><a name="zh-cn_topic_0000001149807881_p15429347165616"></a><a name="zh-cn_topic_0000001149807881_p15429347165616"></a>说明</p> 1879</th> 1880</tr> 1881</thead> 1882<tbody><tr id="zh-cn_topic_0000001149807881_row19631511495"><td class="cellrowborder" valign="top" width="26.06%" headers="mcps1.1.3.1.1 "><p id="zh-cn_topic_0000001149807881_p963131110911"><a name="zh-cn_topic_0000001149807881_p963131110911"></a><a name="zh-cn_topic_0000001149807881_p963131110911"></a>Promise<void></p> 1883</td> 1884<td class="cellrowborder" valign="top" width="73.94%" headers="mcps1.1.3.1.2 "><p id="zh-cn_topic_0000001149807881_p2632911495"><a name="zh-cn_topic_0000001149807881_p2632911495"></a><a name="zh-cn_topic_0000001149807881_p2632911495"></a>Promise回调返回设置成功或失败。</p> 1885</td> 1886</tr> 1887</tbody> 1888</table> 1889 1890**示例:** 1891 1892``` 1893audioManager.setMicrophoneMute(true).then(() => 1894 console.log('Promise returned to indicate that the microphone is muted.'); 1895) 1896``` 1897 1898### isMicrophoneMute\(callback: AsyncCallback<boolean\>\): void<sup>7+</sup><a name="zh-cn_topic_0000001149807881_section6632141119912"></a> 1899 1900获取麦克风静音状态,使用callback方式返回异步结果。 1901 1902**参数:** 1903 1904<a name="zh-cn_topic_0000001149807881_table263341115910"></a> 1905<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row963351114915"><th class="cellrowborder" valign="top" width="17.57%" id="mcps1.1.5.1.1"><p id="zh-cn_topic_0000001149807881_p17609143285813"><a name="zh-cn_topic_0000001149807881_p17609143285813"></a><a name="zh-cn_topic_0000001149807881_p17609143285813"></a>参数名</p> 1906</th> 1907<th class="cellrowborder" valign="top" width="19.52%" id="mcps1.1.5.1.2"><p id="zh-cn_topic_0000001149807881_p1460953214582"><a name="zh-cn_topic_0000001149807881_p1460953214582"></a><a name="zh-cn_topic_0000001149807881_p1460953214582"></a>类型</p> 1908</th> 1909<th class="cellrowborder" valign="top" width="8.38%" id="mcps1.1.5.1.3"><p id="zh-cn_topic_0000001149807881_p4609103219585"><a name="zh-cn_topic_0000001149807881_p4609103219585"></a><a name="zh-cn_topic_0000001149807881_p4609103219585"></a>必填</p> 1910</th> 1911<th class="cellrowborder" valign="top" width="54.53%" id="mcps1.1.5.1.4"><p id="zh-cn_topic_0000001149807881_p13609332195816"><a name="zh-cn_topic_0000001149807881_p13609332195816"></a><a name="zh-cn_topic_0000001149807881_p13609332195816"></a>说明</p> 1912</th> 1913</tr> 1914</thead> 1915<tbody><tr id="zh-cn_topic_0000001149807881_row863416111912"><td class="cellrowborder" valign="top" width="17.57%" headers="mcps1.1.5.1.1 "><p id="zh-cn_topic_0000001149807881_p136341311990"><a name="zh-cn_topic_0000001149807881_p136341311990"></a><a name="zh-cn_topic_0000001149807881_p136341311990"></a>callback</p> 1916</td> 1917<td class="cellrowborder" valign="top" width="19.52%" headers="mcps1.1.5.1.2 "><p id="zh-cn_topic_0000001149807881_p263413111799"><a name="zh-cn_topic_0000001149807881_p263413111799"></a><a name="zh-cn_topic_0000001149807881_p263413111799"></a>AsyncCallback<boolean></p> 1918</td> 1919<td class="cellrowborder" valign="top" width="8.38%" headers="mcps1.1.5.1.3 "><p id="zh-cn_topic_0000001149807881_p1563571116915"><a name="zh-cn_topic_0000001149807881_p1563571116915"></a><a name="zh-cn_topic_0000001149807881_p1563571116915"></a>是</p> 1920</td> 1921<td class="cellrowborder" valign="top" width="54.53%" headers="mcps1.1.5.1.4 "><p id="zh-cn_topic_0000001149807881_p7929533121617"><a name="zh-cn_topic_0000001149807881_p7929533121617"></a><a name="zh-cn_topic_0000001149807881_p7929533121617"></a>回调返回系统麦克风静音状态,true为静音,false为非静音。</p> 1922</td> 1923</tr> 1924</tbody> 1925</table> 1926 1927**返回值:** 1928 1929无 1930 1931**示例:** 1932 1933``` 1934audioManager.isMicrophoneMute((err, value) => { 1935 if (err) { 1936 console.error('Failed to obtain the mute status of the microphone. ${err.message}'); 1937 return; 1938 } 1939 console.log('Callback invoked to indicate that the mute status of the microphone is obtained.' + value); 1940}) 1941``` 1942 1943### isMicrophoneMute\(\): Promise<boolean\><sup>7+</sup><a name="zh-cn_topic_0000001149807881_section196363111918"></a> 1944 1945获取麦克风静音状态,使用promise方式返回异步结果。 1946 1947**参数:** 1948 1949无 1950 1951**返回值:** 1952 1953<a name="zh-cn_topic_0000001149807881_table1563618111590"></a> 1954<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row1563614111198"><th class="cellrowborder" valign="top" width="25.97%" id="mcps1.1.3.1.1"><p id="zh-cn_topic_0000001149807881_p4631195085616"><a name="zh-cn_topic_0000001149807881_p4631195085616"></a><a name="zh-cn_topic_0000001149807881_p4631195085616"></a>类型</p> 1955</th> 1956<th class="cellrowborder" valign="top" width="74.03%" id="mcps1.1.3.1.2"><p id="zh-cn_topic_0000001149807881_p2063115065618"><a name="zh-cn_topic_0000001149807881_p2063115065618"></a><a name="zh-cn_topic_0000001149807881_p2063115065618"></a>说明</p> 1957</th> 1958</tr> 1959</thead> 1960<tbody><tr id="zh-cn_topic_0000001149807881_row2063711111794"><td class="cellrowborder" valign="top" width="25.97%" headers="mcps1.1.3.1.1 "><p id="zh-cn_topic_0000001149807881_p7637511798"><a name="zh-cn_topic_0000001149807881_p7637511798"></a><a name="zh-cn_topic_0000001149807881_p7637511798"></a>Promise<boolean></p> 1961</td> 1962<td class="cellrowborder" valign="top" width="74.03%" headers="mcps1.1.3.1.2 "><p id="zh-cn_topic_0000001149807881_p9637191112911"><a name="zh-cn_topic_0000001149807881_p9637191112911"></a><a name="zh-cn_topic_0000001149807881_p9637191112911"></a>Promise回调返回系统麦克风静音状态,true为静音,false为非静音。</p> 1963</td> 1964</tr> 1965</tbody> 1966</table> 1967 1968**示例:** 1969 1970``` 1971audioManager.isMicrophoneMute().then((value) => 1972 console.log('Promise returned to indicate that the mute status of the microphone is obtained.', + value); 1973) 1974``` 1975 1976## AudioDeviceDescriptor<a name="zh-cn_topic_0000001149807881_section164657411927"></a> 1977 1978描述音频设备。 1979 1980### 属性<a name="zh-cn_topic_0000001149807881_section4947115405"></a> 1981 1982<a name="zh-cn_topic_0000001149807881_table92548495595"></a> 1983<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row132541749175917"><th class="cellrowborder" valign="top" width="22.65226522652265%" id="mcps1.1.6.1.1"><p id="zh-cn_topic_0000001149807881_p925404965919"><a name="zh-cn_topic_0000001149807881_p925404965919"></a><a name="zh-cn_topic_0000001149807881_p925404965919"></a>名称</p> 1984</th> 1985<th class="cellrowborder" valign="top" width="17.021702170217022%" id="mcps1.1.6.1.2"><p id="zh-cn_topic_0000001149807881_p325464914599"><a name="zh-cn_topic_0000001149807881_p325464914599"></a><a name="zh-cn_topic_0000001149807881_p325464914599"></a>参数型</p> 1986</th> 1987<th class="cellrowborder" valign="top" width="8.720872087208722%" id="mcps1.1.6.1.3"><p id="zh-cn_topic_0000001149807881_p025484918596"><a name="zh-cn_topic_0000001149807881_p025484918596"></a><a name="zh-cn_topic_0000001149807881_p025484918596"></a>可读</p> 1988</th> 1989<th class="cellrowborder" valign="top" width="13.881388138813882%" id="mcps1.1.6.1.4"><p id="zh-cn_topic_0000001149807881_p025414499590"><a name="zh-cn_topic_0000001149807881_p025414499590"></a><a name="zh-cn_topic_0000001149807881_p025414499590"></a>可写</p> 1990</th> 1991<th class="cellrowborder" valign="top" width="37.72377237723772%" id="mcps1.1.6.1.5"><p id="zh-cn_topic_0000001149807881_p20254134925912"><a name="zh-cn_topic_0000001149807881_p20254134925912"></a><a name="zh-cn_topic_0000001149807881_p20254134925912"></a>说明</p> 1992</th> 1993</tr> 1994</thead> 1995<tbody><tr id="zh-cn_topic_0000001149807881_row18254849155915"><td class="cellrowborder" valign="top" width="22.65226522652265%" headers="mcps1.1.6.1.1 "><p id="zh-cn_topic_0000001149807881_p4909151512710"><a name="zh-cn_topic_0000001149807881_p4909151512710"></a><a name="zh-cn_topic_0000001149807881_p4909151512710"></a>deviceRole</p> 1996</td> 1997<td class="cellrowborder" valign="top" width="17.021702170217022%" headers="mcps1.1.6.1.2 "><p id="zh-cn_topic_0000001149807881_p262713618564"><a name="zh-cn_topic_0000001149807881_p262713618564"></a><a name="zh-cn_topic_0000001149807881_p262713618564"></a><a href="#zh-cn_topic_0000001149807881_section380038142619">DeviceRole</a></p> 1998</td> 1999<td class="cellrowborder" valign="top" width="8.720872087208722%" headers="mcps1.1.6.1.3 "><p id="zh-cn_topic_0000001149807881_p8254749195914"><a name="zh-cn_topic_0000001149807881_p8254749195914"></a><a name="zh-cn_topic_0000001149807881_p8254749195914"></a>是</p> 2000</td> 2001<td class="cellrowborder" valign="top" width="13.881388138813882%" headers="mcps1.1.6.1.4 "><p id="zh-cn_topic_0000001149807881_p5255549115910"><a name="zh-cn_topic_0000001149807881_p5255549115910"></a><a name="zh-cn_topic_0000001149807881_p5255549115910"></a>否</p> 2002</td> 2003<td class="cellrowborder" valign="top" width="37.72377237723772%" headers="mcps1.1.6.1.5 "><p id="zh-cn_topic_0000001149807881_p11973171511560"><a name="zh-cn_topic_0000001149807881_p11973171511560"></a><a name="zh-cn_topic_0000001149807881_p11973171511560"></a>设备角色。</p> 2004</td> 2005</tr> 2006<tr id="zh-cn_topic_0000001149807881_row3558145812553"><td class="cellrowborder" valign="top" width="22.65226522652265%" headers="mcps1.1.6.1.1 "><p id="zh-cn_topic_0000001149807881_p1155815580552"><a name="zh-cn_topic_0000001149807881_p1155815580552"></a><a name="zh-cn_topic_0000001149807881_p1155815580552"></a>deviceType</p> 2007</td> 2008<td class="cellrowborder" valign="top" width="17.021702170217022%" headers="mcps1.1.6.1.2 "><p id="zh-cn_topic_0000001149807881_p5558165811550"><a name="zh-cn_topic_0000001149807881_p5558165811550"></a><a name="zh-cn_topic_0000001149807881_p5558165811550"></a><a href="#zh-cn_topic_0000001149807881_section11727420122710">DeviceType</a></p> 2009</td> 2010<td class="cellrowborder" valign="top" width="8.720872087208722%" headers="mcps1.1.6.1.3 "><p id="zh-cn_topic_0000001149807881_p17539151215617"><a name="zh-cn_topic_0000001149807881_p17539151215617"></a><a name="zh-cn_topic_0000001149807881_p17539151215617"></a>是</p> 2011</td> 2012<td class="cellrowborder" valign="top" width="13.881388138813882%" headers="mcps1.1.6.1.4 "><p id="zh-cn_topic_0000001149807881_p85391712105612"><a name="zh-cn_topic_0000001149807881_p85391712105612"></a><a name="zh-cn_topic_0000001149807881_p85391712105612"></a>否</p> 2013</td> 2014<td class="cellrowborder" valign="top" width="37.72377237723772%" headers="mcps1.1.6.1.5 "><p id="zh-cn_topic_0000001149807881_p525718188565"><a name="zh-cn_topic_0000001149807881_p525718188565"></a><a name="zh-cn_topic_0000001149807881_p525718188565"></a>设备类型。</p> 2015</td> 2016</tr> 2017</tbody> 2018</table> 2019 2020## AudioDeviceDescriptors<a name="zh-cn_topic_0000001149807881_section5181155710523"></a> 2021 2022<a name="zh-cn_topic_0000001149807881_table169751229266"></a> 2023<table><thead align="left"><tr id="zh-cn_topic_0000001149807881_row169757224268"><th class="cellrowborder" valign="top" width="19.7%" id="mcps1.1.3.1.1"><p id="zh-cn_topic_0000001149807881_p19975182202612"><a name="zh-cn_topic_0000001149807881_p19975182202612"></a><a name="zh-cn_topic_0000001149807881_p19975182202612"></a>名称</p> 2024</th> 2025<th class="cellrowborder" valign="top" width="80.30000000000001%" id="mcps1.1.3.1.2"><p id="zh-cn_topic_0000001149807881_p109751622132611"><a name="zh-cn_topic_0000001149807881_p109751622132611"></a><a name="zh-cn_topic_0000001149807881_p109751622132611"></a>描述</p> 2026</th> 2027</tr> 2028</thead> 2029<tbody><tr id="zh-cn_topic_0000001149807881_row169751322182613"><td class="cellrowborder" valign="top" width="19.7%" headers="mcps1.1.3.1.1 "><p id="zh-cn_topic_0000001149807881_p139751522182616"><a name="zh-cn_topic_0000001149807881_p139751522182616"></a><a name="zh-cn_topic_0000001149807881_p139751522182616"></a>设备属性数组</p> 2030</td> 2031<td class="cellrowborder" valign="top" width="80.30000000000001%" headers="mcps1.1.3.1.2 "><p id="zh-cn_topic_0000001149807881_p597532272616"><a name="zh-cn_topic_0000001149807881_p597532272616"></a><a name="zh-cn_topic_0000001149807881_p597532272616"></a>AudioDeviceDescriptor的数组,只读。</p> 2032</td> 2033</tr> 2034</tbody> 2035</table> 2036 2037