AudioServer.xml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="AudioServer" inherits="Object" version="3.3">
  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 title="Audio buses">https://docs.godotengine.org/en/3.3/tutorials/audio/audio_buses.html</link>
  11. <link title="Audio Device Changer Demo">https://godotengine.org/asset-library/asset/525</link>
  12. <link title="Audio Mic Record Demo">https://godotengine.org/asset-library/asset/527</link>
  13. <link title="Audio Spectrum Demo">https://godotengine.org/asset-library/asset/528</link>
  14. </tutorials>
  15. <methods>
  16. <method name="add_bus">
  17. <return type="void">
  18. </return>
  19. <argument index="0" name="at_position" type="int" default="-1">
  20. </argument>
  21. <description>
  22. Adds a bus at [code]at_position[/code].
  23. </description>
  24. </method>
  25. <method name="add_bus_effect">
  26. <return type="void">
  27. </return>
  28. <argument index="0" name="bus_idx" type="int">
  29. </argument>
  30. <argument index="1" name="effect" type="AudioEffect">
  31. </argument>
  32. <argument index="2" name="at_position" type="int" default="-1">
  33. </argument>
  34. <description>
  35. Adds an [AudioEffect] effect to the bus [code]bus_idx[/code] at [code]at_position[/code].
  36. </description>
  37. </method>
  38. <method name="capture_get_device">
  39. <return type="String">
  40. </return>
  41. <description>
  42. Name of the current device for audio input (see [method capture_get_device_list]).
  43. </description>
  44. </method>
  45. <method name="capture_get_device_list">
  46. <return type="Array">
  47. </return>
  48. <description>
  49. Returns the names of all audio input devices detected on the system.
  50. </description>
  51. </method>
  52. <method name="capture_set_device">
  53. <return type="void">
  54. </return>
  55. <argument index="0" name="name" type="String">
  56. </argument>
  57. <description>
  58. Sets which audio input device is used for audio capture.
  59. </description>
  60. </method>
  61. <method name="generate_bus_layout" qualifiers="const">
  62. <return type="AudioBusLayout">
  63. </return>
  64. <description>
  65. Generates an [AudioBusLayout] using the available buses and effects.
  66. </description>
  67. </method>
  68. <method name="get_bus_channels" qualifiers="const">
  69. <return type="int">
  70. </return>
  71. <argument index="0" name="bus_idx" type="int">
  72. </argument>
  73. <description>
  74. Returns the amount of channels of the bus at index [code]bus_idx[/code].
  75. </description>
  76. </method>
  77. <method name="get_bus_effect">
  78. <return type="AudioEffect">
  79. </return>
  80. <argument index="0" name="bus_idx" type="int">
  81. </argument>
  82. <argument index="1" name="effect_idx" type="int">
  83. </argument>
  84. <description>
  85. Returns the [AudioEffect] at position [code]effect_idx[/code] in bus [code]bus_idx[/code].
  86. </description>
  87. </method>
  88. <method name="get_bus_effect_count">
  89. <return type="int">
  90. </return>
  91. <argument index="0" name="bus_idx" type="int">
  92. </argument>
  93. <description>
  94. Returns the number of effects on the bus at [code]bus_idx[/code].
  95. </description>
  96. </method>
  97. <method name="get_bus_effect_instance">
  98. <return type="AudioEffectInstance">
  99. </return>
  100. <argument index="0" name="bus_idx" type="int">
  101. </argument>
  102. <argument index="1" name="effect_idx" type="int">
  103. </argument>
  104. <argument index="2" name="channel" type="int" default="0">
  105. </argument>
  106. <description>
  107. Returns the [AudioEffectInstance] assigned to the given bus and effect indices (and optionally channel).
  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_list">
  169. <return type="Array">
  170. </return>
  171. <description>
  172. Returns the names of all audio devices detected on the system.
  173. </description>
  174. </method>
  175. <method name="get_mix_rate" qualifiers="const">
  176. <return type="float">
  177. </return>
  178. <description>
  179. Returns the sample rate at the output of the [AudioServer].
  180. </description>
  181. </method>
  182. <method name="get_output_latency" qualifiers="const">
  183. <return type="float">
  184. </return>
  185. <description>
  186. Returns the audio driver's output latency.
  187. </description>
  188. </method>
  189. <method name="get_speaker_mode" qualifiers="const">
  190. <return type="int" enum="AudioServer.SpeakerMode">
  191. </return>
  192. <description>
  193. Returns the speaker configuration.
  194. </description>
  195. </method>
  196. <method name="get_time_since_last_mix" qualifiers="const">
  197. <return type="float">
  198. </return>
  199. <description>
  200. Returns the relative time since the last mix occurred.
  201. </description>
  202. </method>
  203. <method name="get_time_to_next_mix" qualifiers="const">
  204. <return type="float">
  205. </return>
  206. <description>
  207. Returns the relative time until the next mix occurs.
  208. </description>
  209. </method>
  210. <method name="is_bus_bypassing_effects" qualifiers="const">
  211. <return type="bool">
  212. </return>
  213. <argument index="0" name="bus_idx" type="int">
  214. </argument>
  215. <description>
  216. If [code]true[/code], the bus at index [code]bus_idx[/code] is bypassing effects.
  217. </description>
  218. </method>
  219. <method name="is_bus_effect_enabled" qualifiers="const">
  220. <return type="bool">
  221. </return>
  222. <argument index="0" name="bus_idx" type="int">
  223. </argument>
  224. <argument index="1" name="effect_idx" type="int">
  225. </argument>
  226. <description>
  227. If [code]true[/code], the effect at index [code]effect_idx[/code] on the bus at index [code]bus_idx[/code] is enabled.
  228. </description>
  229. </method>
  230. <method name="is_bus_mute" qualifiers="const">
  231. <return type="bool">
  232. </return>
  233. <argument index="0" name="bus_idx" type="int">
  234. </argument>
  235. <description>
  236. If [code]true[/code], the bus at index [code]bus_idx[/code] is muted.
  237. </description>
  238. </method>
  239. <method name="is_bus_solo" qualifiers="const">
  240. <return type="bool">
  241. </return>
  242. <argument index="0" name="bus_idx" type="int">
  243. </argument>
  244. <description>
  245. If [code]true[/code], the bus at index [code]bus_idx[/code] is in solo mode.
  246. </description>
  247. </method>
  248. <method name="lock">
  249. <return type="void">
  250. </return>
  251. <description>
  252. Locks the audio driver's main loop.
  253. [b]Note:[/b] Remember to unlock it afterwards.
  254. </description>
  255. </method>
  256. <method name="move_bus">
  257. <return type="void">
  258. </return>
  259. <argument index="0" name="index" type="int">
  260. </argument>
  261. <argument index="1" name="to_index" type="int">
  262. </argument>
  263. <description>
  264. Moves the bus from index [code]index[/code] to index [code]to_index[/code].
  265. </description>
  266. </method>
  267. <method name="remove_bus">
  268. <return type="void">
  269. </return>
  270. <argument index="0" name="index" type="int">
  271. </argument>
  272. <description>
  273. Removes the bus at index [code]index[/code].
  274. </description>
  275. </method>
  276. <method name="remove_bus_effect">
  277. <return type="void">
  278. </return>
  279. <argument index="0" name="bus_idx" type="int">
  280. </argument>
  281. <argument index="1" name="effect_idx" type="int">
  282. </argument>
  283. <description>
  284. Removes the effect at index [code]effect_idx[/code] from the bus at index [code]bus_idx[/code].
  285. </description>
  286. </method>
  287. <method name="set_bus_bypass_effects">
  288. <return type="void">
  289. </return>
  290. <argument index="0" name="bus_idx" type="int">
  291. </argument>
  292. <argument index="1" name="enable" type="bool">
  293. </argument>
  294. <description>
  295. If [code]true[/code], the bus at index [code]bus_idx[/code] is bypassing effects.
  296. </description>
  297. </method>
  298. <method name="set_bus_effect_enabled">
  299. <return type="void">
  300. </return>
  301. <argument index="0" name="bus_idx" type="int">
  302. </argument>
  303. <argument index="1" name="effect_idx" type="int">
  304. </argument>
  305. <argument index="2" name="enabled" type="bool">
  306. </argument>
  307. <description>
  308. If [code]true[/code], the effect at index [code]effect_idx[/code] on the bus at index [code]bus_idx[/code] is enabled.
  309. </description>
  310. </method>
  311. <method name="set_bus_layout">
  312. <return type="void">
  313. </return>
  314. <argument index="0" name="bus_layout" type="AudioBusLayout">
  315. </argument>
  316. <description>
  317. Overwrites the currently used [AudioBusLayout].
  318. </description>
  319. </method>
  320. <method name="set_bus_mute">
  321. <return type="void">
  322. </return>
  323. <argument index="0" name="bus_idx" type="int">
  324. </argument>
  325. <argument index="1" name="enable" type="bool">
  326. </argument>
  327. <description>
  328. If [code]true[/code], the bus at index [code]bus_idx[/code] is muted.
  329. </description>
  330. </method>
  331. <method name="set_bus_name">
  332. <return type="void">
  333. </return>
  334. <argument index="0" name="bus_idx" type="int">
  335. </argument>
  336. <argument index="1" name="name" type="String">
  337. </argument>
  338. <description>
  339. Sets the name of the bus at index [code]bus_idx[/code] to [code]name[/code].
  340. </description>
  341. </method>
  342. <method name="set_bus_send">
  343. <return type="void">
  344. </return>
  345. <argument index="0" name="bus_idx" type="int">
  346. </argument>
  347. <argument index="1" name="send" type="String">
  348. </argument>
  349. <description>
  350. Connects the output of the bus at [code]bus_idx[/code] to the bus named [code]send[/code].
  351. </description>
  352. </method>
  353. <method name="set_bus_solo">
  354. <return type="void">
  355. </return>
  356. <argument index="0" name="bus_idx" type="int">
  357. </argument>
  358. <argument index="1" name="enable" type="bool">
  359. </argument>
  360. <description>
  361. If [code]true[/code], the bus at index [code]bus_idx[/code] is in solo mode.
  362. </description>
  363. </method>
  364. <method name="set_bus_volume_db">
  365. <return type="void">
  366. </return>
  367. <argument index="0" name="bus_idx" type="int">
  368. </argument>
  369. <argument index="1" name="volume_db" type="float">
  370. </argument>
  371. <description>
  372. Sets the volume of the bus at index [code]bus_idx[/code] to [code]volume_db[/code].
  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 audio driver's main loop. (After locking it, you should always unlock it.)
  393. </description>
  394. </method>
  395. </methods>
  396. <members>
  397. <member name="bus_count" type="int" setter="set_bus_count" getter="get_bus_count" default="1">
  398. Number of available audio buses.
  399. </member>
  400. <member name="device" type="String" setter="set_device" getter="get_device" default="&quot;Default&quot;">
  401. Name of the current device for audio output (see [method get_device_list]).
  402. </member>
  403. <member name="global_rate_scale" type="float" setter="set_global_rate_scale" getter="get_global_rate_scale" default="1.0">
  404. Scales the rate at which audio is played (i.e. setting it to [code]0.5[/code] will make the audio be played twice as fast).
  405. </member>
  406. </members>
  407. <signals>
  408. <signal name="bus_layout_changed">
  409. <description>
  410. Emitted when the [AudioBusLayout] changes.
  411. </description>
  412. </signal>
  413. </signals>
  414. <constants>
  415. <constant name="SPEAKER_MODE_STEREO" value="0" enum="SpeakerMode">
  416. Two or fewer speakers were detected.
  417. </constant>
  418. <constant name="SPEAKER_SURROUND_31" value="1" enum="SpeakerMode">
  419. A 3.1 channel surround setup was detected.
  420. </constant>
  421. <constant name="SPEAKER_SURROUND_51" value="2" enum="SpeakerMode">
  422. A 5.1 channel surround setup was detected.
  423. </constant>
  424. <constant name="SPEAKER_SURROUND_71" value="3" enum="SpeakerMode">
  425. A 7.1 channel surround setup was detected.
  426. </constant>
  427. </constants>
  428. </class>