AudioServer.xml 12 KB

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