AudioServer.xml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="AudioServer" inherits="Object" category="Core" version="3.1.2">
  3. <brief_description>
  4. Server interface for low level audio access.
  5. </brief_description>
  6. <description>
  7. AudioServer is a low level server interface for audio access. It is in charge of creating sample data (playable audio) as well as its playback via a voice interface.
  8. </description>
  9. <tutorials>
  10. <link>https://docs.godotengine.org/en/3.1/tutorials/audio/audio_buses.html</link>
  11. </tutorials>
  12. <methods>
  13. <method name="add_bus">
  14. <return type="void">
  15. </return>
  16. <argument index="0" name="at_position" type="int" default="-1">
  17. </argument>
  18. <description>
  19. Adds a bus at [code]at_position[/code].
  20. </description>
  21. </method>
  22. <method name="add_bus_effect">
  23. <return type="void">
  24. </return>
  25. <argument index="0" name="bus_idx" type="int">
  26. </argument>
  27. <argument index="1" name="effect" type="AudioEffect">
  28. </argument>
  29. <argument index="2" name="at_position" type="int" default="-1">
  30. </argument>
  31. <description>
  32. Adds an [AudioEffect] effect to the bus [code]bus_idx[/code] at [code]at_position[/code].
  33. </description>
  34. </method>
  35. <method name="capture_get_device">
  36. <return type="String">
  37. </return>
  38. <description>
  39. </description>
  40. </method>
  41. <method name="capture_get_device_list">
  42. <return type="Array">
  43. </return>
  44. <description>
  45. </description>
  46. </method>
  47. <method name="capture_set_device">
  48. <return type="void">
  49. </return>
  50. <argument index="0" name="name" type="String">
  51. </argument>
  52. <description>
  53. </description>
  54. </method>
  55. <method name="generate_bus_layout" qualifiers="const">
  56. <return type="AudioBusLayout">
  57. </return>
  58. <description>
  59. Generates an [AudioBusLayout] using the available buses and effects.
  60. </description>
  61. </method>
  62. <method name="get_bus_channels" qualifiers="const">
  63. <return type="int">
  64. </return>
  65. <argument index="0" name="bus_idx" type="int">
  66. </argument>
  67. <description>
  68. Returns the amount of channels of the bus at index [code]bus_idx[/code].
  69. </description>
  70. </method>
  71. <method name="get_bus_count" qualifiers="const">
  72. <return type="int">
  73. </return>
  74. <description>
  75. Returns the number of available buses.
  76. </description>
  77. </method>
  78. <method name="get_bus_effect">
  79. <return type="AudioEffect">
  80. </return>
  81. <argument index="0" name="bus_idx" type="int">
  82. </argument>
  83. <argument index="1" name="effect_idx" type="int">
  84. </argument>
  85. <description>
  86. Returns the [AudioEffect] at position [code]effect_idx[/code] in bus [code]bus_idx[/code].
  87. </description>
  88. </method>
  89. <method name="get_bus_effect_count">
  90. <return type="int">
  91. </return>
  92. <argument index="0" name="bus_idx" type="int">
  93. </argument>
  94. <description>
  95. Returns the number of effects on the bus at [code]bus_idx[/code].
  96. </description>
  97. </method>
  98. <method name="get_bus_effect_instance">
  99. <return type="AudioEffectInstance">
  100. </return>
  101. <argument index="0" name="bus_idx" type="int">
  102. </argument>
  103. <argument index="1" name="effect_idx" type="int">
  104. </argument>
  105. <argument index="2" name="channel" type="int" default="0">
  106. </argument>
  107. <description>
  108. </description>
  109. </method>
  110. <method name="get_bus_index" qualifiers="const">
  111. <return type="int">
  112. </return>
  113. <argument index="0" name="bus_name" type="String">
  114. </argument>
  115. <description>
  116. Returns the index of the bus with the name [code]bus_name[/code].
  117. </description>
  118. </method>
  119. <method name="get_bus_name" qualifiers="const">
  120. <return type="String">
  121. </return>
  122. <argument index="0" name="bus_idx" type="int">
  123. </argument>
  124. <description>
  125. Returns the name of the bus with the index [code]bus_idx[/code].
  126. </description>
  127. </method>
  128. <method name="get_bus_peak_volume_left_db" qualifiers="const">
  129. <return type="float">
  130. </return>
  131. <argument index="0" name="bus_idx" type="int">
  132. </argument>
  133. <argument index="1" name="channel" type="int">
  134. </argument>
  135. <description>
  136. Returns the peak volume of the left speaker at bus index [code]bus_idx[/code] and channel index [code]channel[/code].
  137. </description>
  138. </method>
  139. <method name="get_bus_peak_volume_right_db" qualifiers="const">
  140. <return type="float">
  141. </return>
  142. <argument index="0" name="bus_idx" type="int">
  143. </argument>
  144. <argument index="1" name="channel" type="int">
  145. </argument>
  146. <description>
  147. Returns the peak volume of the right speaker at bus index [code]bus_idx[/code] and channel index [code]channel[/code].
  148. </description>
  149. </method>
  150. <method name="get_bus_send" qualifiers="const">
  151. <return type="String">
  152. </return>
  153. <argument index="0" name="bus_idx" type="int">
  154. </argument>
  155. <description>
  156. Returns the name of the bus that the bus at index [code]bus_idx[/code] sends to.
  157. </description>
  158. </method>
  159. <method name="get_bus_volume_db" qualifiers="const">
  160. <return type="float">
  161. </return>
  162. <argument index="0" name="bus_idx" type="int">
  163. </argument>
  164. <description>
  165. Returns the volume of the bus at index [code]bus_idx[/code] in dB.
  166. </description>
  167. </method>
  168. <method name="get_device">
  169. <return type="String">
  170. </return>
  171. <description>
  172. </description>
  173. </method>
  174. <method name="get_device_list">
  175. <return type="Array">
  176. </return>
  177. <description>
  178. </description>
  179. </method>
  180. <method name="get_mix_rate" qualifiers="const">
  181. <return type="float">
  182. </return>
  183. <description>
  184. Returns the sample rate at the output of the audioserver.
  185. </description>
  186. </method>
  187. <method name="get_speaker_mode" qualifiers="const">
  188. <return type="int" enum="AudioServer.SpeakerMode">
  189. </return>
  190. <description>
  191. Returns the speaker configuration.
  192. </description>
  193. </method>
  194. <method name="is_bus_bypassing_effects" qualifiers="const">
  195. <return type="bool">
  196. </return>
  197. <argument index="0" name="bus_idx" type="int">
  198. </argument>
  199. <description>
  200. If [code]true[/code], the bus at index [code]bus_idx[/code] is bypassing effects.
  201. </description>
  202. </method>
  203. <method name="is_bus_effect_enabled" qualifiers="const">
  204. <return type="bool">
  205. </return>
  206. <argument index="0" name="bus_idx" type="int">
  207. </argument>
  208. <argument index="1" name="effect_idx" type="int">
  209. </argument>
  210. <description>
  211. If [code]true[/code], the effect at index [code]effect_idx[/code] on the bus at index [code]bus_idx[/code] is enabled.
  212. </description>
  213. </method>
  214. <method name="is_bus_mute" qualifiers="const">
  215. <return type="bool">
  216. </return>
  217. <argument index="0" name="bus_idx" type="int">
  218. </argument>
  219. <description>
  220. If [code]true[/code], the bus at index [code]bus_idx[/code] is muted.
  221. </description>
  222. </method>
  223. <method name="is_bus_solo" qualifiers="const">
  224. <return type="bool">
  225. </return>
  226. <argument index="0" name="bus_idx" type="int">
  227. </argument>
  228. <description>
  229. If [code]true[/code], the bus at index [code]bus_idx[/code] is in solo mode.
  230. </description>
  231. </method>
  232. <method name="lock">
  233. <return type="void">
  234. </return>
  235. <description>
  236. Locks the audio drivers mainloop. Remember to unlock it afterwards.
  237. </description>
  238. </method>
  239. <method name="move_bus">
  240. <return type="void">
  241. </return>
  242. <argument index="0" name="index" type="int">
  243. </argument>
  244. <argument index="1" name="to_index" type="int">
  245. </argument>
  246. <description>
  247. Moves the bus from index [code]index[/code] to index [code]to_index[/code].
  248. </description>
  249. </method>
  250. <method name="remove_bus">
  251. <return type="void">
  252. </return>
  253. <argument index="0" name="index" type="int">
  254. </argument>
  255. <description>
  256. Removes the bus at index [code]index[/code].
  257. </description>
  258. </method>
  259. <method name="remove_bus_effect">
  260. <return type="void">
  261. </return>
  262. <argument index="0" name="bus_idx" type="int">
  263. </argument>
  264. <argument index="1" name="effect_idx" type="int">
  265. </argument>
  266. <description>
  267. Removes the effect at index [code]effect_idx[/code] from the bus at index [code]bus_idx[/code].
  268. </description>
  269. </method>
  270. <method name="set_bus_bypass_effects">
  271. <return type="void">
  272. </return>
  273. <argument index="0" name="bus_idx" type="int">
  274. </argument>
  275. <argument index="1" name="enable" type="bool">
  276. </argument>
  277. <description>
  278. If [code]true[/code], the bus at index [code]bus_idx[/code] is bypassing effects.
  279. </description>
  280. </method>
  281. <method name="set_bus_count">
  282. <return type="void">
  283. </return>
  284. <argument index="0" name="amount" type="int">
  285. </argument>
  286. <description>
  287. Adds and removes buses to make the number of buses match [code]amount[/code].
  288. </description>
  289. </method>
  290. <method name="set_bus_effect_enabled">
  291. <return type="void">
  292. </return>
  293. <argument index="0" name="bus_idx" type="int">
  294. </argument>
  295. <argument index="1" name="effect_idx" type="int">
  296. </argument>
  297. <argument index="2" name="enabled" type="bool">
  298. </argument>
  299. <description>
  300. If [code]true[/code], the effect at index [code]effect_idx[/code] on the bus at index [code]bus_idx[/code] is enabled.
  301. </description>
  302. </method>
  303. <method name="set_bus_layout">
  304. <return type="void">
  305. </return>
  306. <argument index="0" name="bus_layout" type="AudioBusLayout">
  307. </argument>
  308. <description>
  309. Overwrites the currently used [AudioBusLayout].
  310. </description>
  311. </method>
  312. <method name="set_bus_mute">
  313. <return type="void">
  314. </return>
  315. <argument index="0" name="bus_idx" type="int">
  316. </argument>
  317. <argument index="1" name="enable" type="bool">
  318. </argument>
  319. <description>
  320. If [code]true[/code], the bus at index [code]bus_idx[/code] is muted.
  321. </description>
  322. </method>
  323. <method name="set_bus_name">
  324. <return type="void">
  325. </return>
  326. <argument index="0" name="bus_idx" type="int">
  327. </argument>
  328. <argument index="1" name="name" type="String">
  329. </argument>
  330. <description>
  331. Sets the name of the bus at index [code]bus_idx[/code] to [code]name[/code].
  332. </description>
  333. </method>
  334. <method name="set_bus_send">
  335. <return type="void">
  336. </return>
  337. <argument index="0" name="bus_idx" type="int">
  338. </argument>
  339. <argument index="1" name="send" type="String">
  340. </argument>
  341. <description>
  342. Connects the output of the bus at [code]bus_idx[/code] to the bus named [code]send[/code].
  343. </description>
  344. </method>
  345. <method name="set_bus_solo">
  346. <return type="void">
  347. </return>
  348. <argument index="0" name="bus_idx" type="int">
  349. </argument>
  350. <argument index="1" name="enable" type="bool">
  351. </argument>
  352. <description>
  353. If [code]true[/code], the bus at index [code]bus_idx[/code] is in solo mode.
  354. </description>
  355. </method>
  356. <method name="set_bus_volume_db">
  357. <return type="void">
  358. </return>
  359. <argument index="0" name="bus_idx" type="int">
  360. </argument>
  361. <argument index="1" name="volume_db" type="float">
  362. </argument>
  363. <description>
  364. Sets the volume of the bus at index [code]bus_idx[/code] to [code]volume_db[/code].
  365. </description>
  366. </method>
  367. <method name="set_device">
  368. <return type="void">
  369. </return>
  370. <argument index="0" name="device" type="String">
  371. </argument>
  372. <description>
  373. </description>
  374. </method>
  375. <method name="swap_bus_effects">
  376. <return type="void">
  377. </return>
  378. <argument index="0" name="bus_idx" type="int">
  379. </argument>
  380. <argument index="1" name="effect_idx" type="int">
  381. </argument>
  382. <argument index="2" name="by_effect_idx" type="int">
  383. </argument>
  384. <description>
  385. Swaps the position of two effects in bus [code]bus_idx[/code].
  386. </description>
  387. </method>
  388. <method name="unlock">
  389. <return type="void">
  390. </return>
  391. <description>
  392. Unlocks the audiodriver's main loop. After locking it always unlock it.
  393. </description>
  394. </method>
  395. </methods>
  396. <signals>
  397. <signal name="bus_layout_changed">
  398. <description>
  399. Emitted when the [AudioBusLayout] changes.
  400. </description>
  401. </signal>
  402. </signals>
  403. <constants>
  404. <constant name="SPEAKER_MODE_STEREO" value="0" enum="SpeakerMode">
  405. Two or fewer speakers are detected.
  406. </constant>
  407. <constant name="SPEAKER_SURROUND_31" value="1" enum="SpeakerMode">
  408. </constant>
  409. <constant name="SPEAKER_SURROUND_51" value="2" enum="SpeakerMode">
  410. A 5.1 channel surround setup detected.
  411. </constant>
  412. <constant name="SPEAKER_SURROUND_71" value="3" enum="SpeakerMode">
  413. A 7.1 channel surround setup detected.
  414. </constant>
  415. </constants>
  416. </class>