AudioServer.xml 11 KB

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