class_audioserver.rst 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/AudioServer.xml.
  6. .. _class_AudioServer:
  7. AudioServer
  8. ===========
  9. **Inherits:** :ref:`Object<class_Object>`
  10. Server interface for low-level audio access.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. **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.
  15. .. rst-class:: classref-introduction-group
  16. Tutorials
  17. ---------
  18. - :doc:`Audio buses <../tutorials/audio/audio_buses>`
  19. - `Audio Device Changer Demo <https://godotengine.org/asset-library/asset/525>`__
  20. - `Audio Mic Record Demo <https://godotengine.org/asset-library/asset/527>`__
  21. - `Audio Spectrum Demo <https://godotengine.org/asset-library/asset/528>`__
  22. .. rst-class:: classref-reftable-group
  23. Properties
  24. ----------
  25. .. table::
  26. :widths: auto
  27. +-----------------------------+------------------------------------------------------------------------+---------------+
  28. | :ref:`int<class_int>` | :ref:`bus_count<class_AudioServer_property_bus_count>` | ``1`` |
  29. +-----------------------------+------------------------------------------------------------------------+---------------+
  30. | :ref:`String<class_String>` | :ref:`capture_device<class_AudioServer_property_capture_device>` | ``"Default"`` |
  31. +-----------------------------+------------------------------------------------------------------------+---------------+
  32. | :ref:`String<class_String>` | :ref:`device<class_AudioServer_property_device>` | ``"Default"`` |
  33. +-----------------------------+------------------------------------------------------------------------+---------------+
  34. | :ref:`float<class_float>` | :ref:`global_rate_scale<class_AudioServer_property_global_rate_scale>` | ``1.0`` |
  35. +-----------------------------+------------------------------------------------------------------------+---------------+
  36. .. rst-class:: classref-reftable-group
  37. Methods
  38. -------
  39. .. table::
  40. :widths: auto
  41. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  42. | void | :ref:`add_bus<class_AudioServer_method_add_bus>` **(** :ref:`int<class_int>` at_position=-1 **)** |
  43. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  44. | void | :ref:`add_bus_effect<class_AudioServer_method_add_bus_effect>` **(** :ref:`int<class_int>` bus_idx, :ref:`AudioEffect<class_AudioEffect>` effect, :ref:`int<class_int>` at_position=-1 **)** |
  45. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  46. | :ref:`Array<class_Array>` | :ref:`capture_get_device_list<class_AudioServer_method_capture_get_device_list>` **(** **)** |
  47. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  48. | :ref:`AudioBusLayout<class_AudioBusLayout>` | :ref:`generate_bus_layout<class_AudioServer_method_generate_bus_layout>` **(** **)** |const| |
  49. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  50. | :ref:`int<class_int>` | :ref:`get_bus_channels<class_AudioServer_method_get_bus_channels>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
  51. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  52. | :ref:`AudioEffect<class_AudioEffect>` | :ref:`get_bus_effect<class_AudioServer_method_get_bus_effect>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)** |
  53. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  54. | :ref:`int<class_int>` | :ref:`get_bus_effect_count<class_AudioServer_method_get_bus_effect_count>` **(** :ref:`int<class_int>` bus_idx **)** |
  55. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  56. | :ref:`AudioEffectInstance<class_AudioEffectInstance>` | :ref:`get_bus_effect_instance<class_AudioServer_method_get_bus_effect_instance>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`int<class_int>` channel=0 **)** |
  57. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  58. | :ref:`int<class_int>` | :ref:`get_bus_index<class_AudioServer_method_get_bus_index>` **(** :ref:`String<class_String>` bus_name **)** |const| |
  59. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  60. | :ref:`String<class_String>` | :ref:`get_bus_name<class_AudioServer_method_get_bus_name>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
  61. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  62. | :ref:`float<class_float>` | :ref:`get_bus_peak_volume_left_db<class_AudioServer_method_get_bus_peak_volume_left_db>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` channel **)** |const| |
  63. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  64. | :ref:`float<class_float>` | :ref:`get_bus_peak_volume_right_db<class_AudioServer_method_get_bus_peak_volume_right_db>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` channel **)** |const| |
  65. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  66. | :ref:`String<class_String>` | :ref:`get_bus_send<class_AudioServer_method_get_bus_send>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
  67. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  68. | :ref:`float<class_float>` | :ref:`get_bus_volume_db<class_AudioServer_method_get_bus_volume_db>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
  69. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  70. | :ref:`Array<class_Array>` | :ref:`get_device_list<class_AudioServer_method_get_device_list>` **(** **)** |
  71. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  72. | :ref:`float<class_float>` | :ref:`get_mix_rate<class_AudioServer_method_get_mix_rate>` **(** **)** |const| |
  73. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  74. | :ref:`float<class_float>` | :ref:`get_output_latency<class_AudioServer_method_get_output_latency>` **(** **)** |const| |
  75. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  76. | :ref:`SpeakerMode<enum_AudioServer_SpeakerMode>` | :ref:`get_speaker_mode<class_AudioServer_method_get_speaker_mode>` **(** **)** |const| |
  77. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  78. | :ref:`float<class_float>` | :ref:`get_time_since_last_mix<class_AudioServer_method_get_time_since_last_mix>` **(** **)** |const| |
  79. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  80. | :ref:`float<class_float>` | :ref:`get_time_to_next_mix<class_AudioServer_method_get_time_to_next_mix>` **(** **)** |const| |
  81. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  82. | :ref:`bool<class_bool>` | :ref:`is_bus_bypassing_effects<class_AudioServer_method_is_bus_bypassing_effects>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
  83. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  84. | :ref:`bool<class_bool>` | :ref:`is_bus_effect_enabled<class_AudioServer_method_is_bus_effect_enabled>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)** |const| |
  85. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  86. | :ref:`bool<class_bool>` | :ref:`is_bus_mute<class_AudioServer_method_is_bus_mute>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
  87. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  88. | :ref:`bool<class_bool>` | :ref:`is_bus_solo<class_AudioServer_method_is_bus_solo>` **(** :ref:`int<class_int>` bus_idx **)** |const| |
  89. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  90. | void | :ref:`lock<class_AudioServer_method_lock>` **(** **)** |
  91. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  92. | void | :ref:`move_bus<class_AudioServer_method_move_bus>` **(** :ref:`int<class_int>` index, :ref:`int<class_int>` to_index **)** |
  93. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  94. | void | :ref:`remove_bus<class_AudioServer_method_remove_bus>` **(** :ref:`int<class_int>` index **)** |
  95. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  96. | void | :ref:`remove_bus_effect<class_AudioServer_method_remove_bus_effect>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)** |
  97. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  98. | void | :ref:`set_bus_bypass_effects<class_AudioServer_method_set_bus_bypass_effects>` **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)** |
  99. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  100. | void | :ref:`set_bus_effect_enabled<class_AudioServer_method_set_bus_effect_enabled>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`bool<class_bool>` enabled **)** |
  101. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  102. | void | :ref:`set_bus_layout<class_AudioServer_method_set_bus_layout>` **(** :ref:`AudioBusLayout<class_AudioBusLayout>` bus_layout **)** |
  103. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  104. | void | :ref:`set_bus_mute<class_AudioServer_method_set_bus_mute>` **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)** |
  105. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  106. | void | :ref:`set_bus_name<class_AudioServer_method_set_bus_name>` **(** :ref:`int<class_int>` bus_idx, :ref:`String<class_String>` name **)** |
  107. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  108. | void | :ref:`set_bus_send<class_AudioServer_method_set_bus_send>` **(** :ref:`int<class_int>` bus_idx, :ref:`String<class_String>` send **)** |
  109. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  110. | void | :ref:`set_bus_solo<class_AudioServer_method_set_bus_solo>` **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)** |
  111. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  112. | void | :ref:`set_bus_volume_db<class_AudioServer_method_set_bus_volume_db>` **(** :ref:`int<class_int>` bus_idx, :ref:`float<class_float>` volume_db **)** |
  113. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  114. | void | :ref:`swap_bus_effects<class_AudioServer_method_swap_bus_effects>` **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`int<class_int>` by_effect_idx **)** |
  115. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  116. | void | :ref:`unlock<class_AudioServer_method_unlock>` **(** **)** |
  117. +-------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
  118. .. rst-class:: classref-section-separator
  119. ----
  120. .. rst-class:: classref-descriptions-group
  121. Signals
  122. -------
  123. .. _class_AudioServer_signal_bus_layout_changed:
  124. .. rst-class:: classref-signal
  125. **bus_layout_changed** **(** **)**
  126. Emitted when the :ref:`AudioBusLayout<class_AudioBusLayout>` changes.
  127. .. rst-class:: classref-section-separator
  128. ----
  129. .. rst-class:: classref-descriptions-group
  130. Enumerations
  131. ------------
  132. .. _enum_AudioServer_SpeakerMode:
  133. .. rst-class:: classref-enumeration
  134. enum **SpeakerMode**:
  135. .. _class_AudioServer_constant_SPEAKER_MODE_STEREO:
  136. .. rst-class:: classref-enumeration-constant
  137. :ref:`SpeakerMode<enum_AudioServer_SpeakerMode>` **SPEAKER_MODE_STEREO** = ``0``
  138. Two or fewer speakers were detected.
  139. .. _class_AudioServer_constant_SPEAKER_SURROUND_31:
  140. .. rst-class:: classref-enumeration-constant
  141. :ref:`SpeakerMode<enum_AudioServer_SpeakerMode>` **SPEAKER_SURROUND_31** = ``1``
  142. A 3.1 channel surround setup was detected.
  143. .. _class_AudioServer_constant_SPEAKER_SURROUND_51:
  144. .. rst-class:: classref-enumeration-constant
  145. :ref:`SpeakerMode<enum_AudioServer_SpeakerMode>` **SPEAKER_SURROUND_51** = ``2``
  146. A 5.1 channel surround setup was detected.
  147. .. _class_AudioServer_constant_SPEAKER_SURROUND_71:
  148. .. rst-class:: classref-enumeration-constant
  149. :ref:`SpeakerMode<enum_AudioServer_SpeakerMode>` **SPEAKER_SURROUND_71** = ``3``
  150. A 7.1 channel surround setup was detected.
  151. .. rst-class:: classref-section-separator
  152. ----
  153. .. rst-class:: classref-descriptions-group
  154. Property Descriptions
  155. ---------------------
  156. .. _class_AudioServer_property_bus_count:
  157. .. rst-class:: classref-property
  158. :ref:`int<class_int>` **bus_count** = ``1``
  159. .. rst-class:: classref-property-setget
  160. - void **set_bus_count** **(** :ref:`int<class_int>` value **)**
  161. - :ref:`int<class_int>` **get_bus_count** **(** **)**
  162. Number of available audio buses.
  163. .. rst-class:: classref-item-separator
  164. ----
  165. .. _class_AudioServer_property_capture_device:
  166. .. rst-class:: classref-property
  167. :ref:`String<class_String>` **capture_device** = ``"Default"``
  168. .. rst-class:: classref-property-setget
  169. - void **capture_set_device** **(** :ref:`String<class_String>` value **)**
  170. - :ref:`String<class_String>` **capture_get_device** **(** **)**
  171. Name of the current device for audio input (see :ref:`capture_get_device_list<class_AudioServer_method_capture_get_device_list>`). On systems with multiple audio inputs (such as analog, USB and HDMI audio), this can be used to select the audio input device. The value ``"Default"`` will record audio on the system-wide default audio input. If an invalid device name is set, the value will be reverted back to ``"Default"``.
  172. \ **Note:** :ref:`ProjectSettings.audio/enable_audio_input<class_ProjectSettings_property_audio/enable_audio_input>` must be ``true`` for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings.
  173. .. rst-class:: classref-item-separator
  174. ----
  175. .. _class_AudioServer_property_device:
  176. .. rst-class:: classref-property
  177. :ref:`String<class_String>` **device** = ``"Default"``
  178. .. rst-class:: classref-property-setget
  179. - void **set_device** **(** :ref:`String<class_String>` value **)**
  180. - :ref:`String<class_String>` **get_device** **(** **)**
  181. Name of the current device for audio output (see :ref:`get_device_list<class_AudioServer_method_get_device_list>`). On systems with multiple audio outputs (such as analog, USB and HDMI audio), this can be used to select the audio output device. The value ``"Default"`` will play audio on the system-wide default audio output. If an invalid device name is set, the value will be reverted back to ``"Default"``.
  182. .. rst-class:: classref-item-separator
  183. ----
  184. .. _class_AudioServer_property_global_rate_scale:
  185. .. rst-class:: classref-property
  186. :ref:`float<class_float>` **global_rate_scale** = ``1.0``
  187. .. rst-class:: classref-property-setget
  188. - void **set_global_rate_scale** **(** :ref:`float<class_float>` value **)**
  189. - :ref:`float<class_float>` **get_global_rate_scale** **(** **)**
  190. Scales the rate at which audio is played (i.e. setting it to ``0.5`` will make the audio be played twice as fast).
  191. .. rst-class:: classref-section-separator
  192. ----
  193. .. rst-class:: classref-descriptions-group
  194. Method Descriptions
  195. -------------------
  196. .. _class_AudioServer_method_add_bus:
  197. .. rst-class:: classref-method
  198. void **add_bus** **(** :ref:`int<class_int>` at_position=-1 **)**
  199. Adds a bus at ``at_position``.
  200. .. rst-class:: classref-item-separator
  201. ----
  202. .. _class_AudioServer_method_add_bus_effect:
  203. .. rst-class:: classref-method
  204. void **add_bus_effect** **(** :ref:`int<class_int>` bus_idx, :ref:`AudioEffect<class_AudioEffect>` effect, :ref:`int<class_int>` at_position=-1 **)**
  205. Adds an :ref:`AudioEffect<class_AudioEffect>` effect to the bus ``bus_idx`` at ``at_position``.
  206. .. rst-class:: classref-item-separator
  207. ----
  208. .. _class_AudioServer_method_capture_get_device_list:
  209. .. rst-class:: classref-method
  210. :ref:`Array<class_Array>` **capture_get_device_list** **(** **)**
  211. Returns the names of all audio input devices detected on the system.
  212. \ **Note:** :ref:`ProjectSettings.audio/enable_audio_input<class_ProjectSettings_property_audio/enable_audio_input>` must be ``true`` for audio input to work. See also that setting's description for caveats related to permissions and operating system privacy settings.
  213. .. rst-class:: classref-item-separator
  214. ----
  215. .. _class_AudioServer_method_generate_bus_layout:
  216. .. rst-class:: classref-method
  217. :ref:`AudioBusLayout<class_AudioBusLayout>` **generate_bus_layout** **(** **)** |const|
  218. Generates an :ref:`AudioBusLayout<class_AudioBusLayout>` using the available buses and effects.
  219. .. rst-class:: classref-item-separator
  220. ----
  221. .. _class_AudioServer_method_get_bus_channels:
  222. .. rst-class:: classref-method
  223. :ref:`int<class_int>` **get_bus_channels** **(** :ref:`int<class_int>` bus_idx **)** |const|
  224. Returns the amount of channels of the bus at index ``bus_idx``.
  225. .. rst-class:: classref-item-separator
  226. ----
  227. .. _class_AudioServer_method_get_bus_effect:
  228. .. rst-class:: classref-method
  229. :ref:`AudioEffect<class_AudioEffect>` **get_bus_effect** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)**
  230. Returns the :ref:`AudioEffect<class_AudioEffect>` at position ``effect_idx`` in bus ``bus_idx``.
  231. .. rst-class:: classref-item-separator
  232. ----
  233. .. _class_AudioServer_method_get_bus_effect_count:
  234. .. rst-class:: classref-method
  235. :ref:`int<class_int>` **get_bus_effect_count** **(** :ref:`int<class_int>` bus_idx **)**
  236. Returns the number of effects on the bus at ``bus_idx``.
  237. .. rst-class:: classref-item-separator
  238. ----
  239. .. _class_AudioServer_method_get_bus_effect_instance:
  240. .. rst-class:: classref-method
  241. :ref:`AudioEffectInstance<class_AudioEffectInstance>` **get_bus_effect_instance** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`int<class_int>` channel=0 **)**
  242. Returns the :ref:`AudioEffectInstance<class_AudioEffectInstance>` assigned to the given bus and effect indices (and optionally channel).
  243. .. rst-class:: classref-item-separator
  244. ----
  245. .. _class_AudioServer_method_get_bus_index:
  246. .. rst-class:: classref-method
  247. :ref:`int<class_int>` **get_bus_index** **(** :ref:`String<class_String>` bus_name **)** |const|
  248. Returns the index of the bus with the name ``bus_name``.
  249. .. rst-class:: classref-item-separator
  250. ----
  251. .. _class_AudioServer_method_get_bus_name:
  252. .. rst-class:: classref-method
  253. :ref:`String<class_String>` **get_bus_name** **(** :ref:`int<class_int>` bus_idx **)** |const|
  254. Returns the name of the bus with the index ``bus_idx``.
  255. .. rst-class:: classref-item-separator
  256. ----
  257. .. _class_AudioServer_method_get_bus_peak_volume_left_db:
  258. .. rst-class:: classref-method
  259. :ref:`float<class_float>` **get_bus_peak_volume_left_db** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` channel **)** |const|
  260. Returns the peak volume of the left speaker at bus index ``bus_idx`` and channel index ``channel``.
  261. .. rst-class:: classref-item-separator
  262. ----
  263. .. _class_AudioServer_method_get_bus_peak_volume_right_db:
  264. .. rst-class:: classref-method
  265. :ref:`float<class_float>` **get_bus_peak_volume_right_db** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` channel **)** |const|
  266. Returns the peak volume of the right speaker at bus index ``bus_idx`` and channel index ``channel``.
  267. .. rst-class:: classref-item-separator
  268. ----
  269. .. _class_AudioServer_method_get_bus_send:
  270. .. rst-class:: classref-method
  271. :ref:`String<class_String>` **get_bus_send** **(** :ref:`int<class_int>` bus_idx **)** |const|
  272. Returns the name of the bus that the bus at index ``bus_idx`` sends to.
  273. .. rst-class:: classref-item-separator
  274. ----
  275. .. _class_AudioServer_method_get_bus_volume_db:
  276. .. rst-class:: classref-method
  277. :ref:`float<class_float>` **get_bus_volume_db** **(** :ref:`int<class_int>` bus_idx **)** |const|
  278. Returns the volume of the bus at index ``bus_idx`` in dB.
  279. .. rst-class:: classref-item-separator
  280. ----
  281. .. _class_AudioServer_method_get_device_list:
  282. .. rst-class:: classref-method
  283. :ref:`Array<class_Array>` **get_device_list** **(** **)**
  284. Returns the names of all audio devices detected on the system.
  285. .. rst-class:: classref-item-separator
  286. ----
  287. .. _class_AudioServer_method_get_mix_rate:
  288. .. rst-class:: classref-method
  289. :ref:`float<class_float>` **get_mix_rate** **(** **)** |const|
  290. Returns the sample rate at the output of the **AudioServer**.
  291. .. rst-class:: classref-item-separator
  292. ----
  293. .. _class_AudioServer_method_get_output_latency:
  294. .. rst-class:: classref-method
  295. :ref:`float<class_float>` **get_output_latency** **(** **)** |const|
  296. Returns the audio driver's output latency. This can be expensive, it is not recommended to call this every frame.
  297. .. rst-class:: classref-item-separator
  298. ----
  299. .. _class_AudioServer_method_get_speaker_mode:
  300. .. rst-class:: classref-method
  301. :ref:`SpeakerMode<enum_AudioServer_SpeakerMode>` **get_speaker_mode** **(** **)** |const|
  302. Returns the speaker configuration.
  303. .. rst-class:: classref-item-separator
  304. ----
  305. .. _class_AudioServer_method_get_time_since_last_mix:
  306. .. rst-class:: classref-method
  307. :ref:`float<class_float>` **get_time_since_last_mix** **(** **)** |const|
  308. Returns the relative time since the last mix occurred.
  309. .. rst-class:: classref-item-separator
  310. ----
  311. .. _class_AudioServer_method_get_time_to_next_mix:
  312. .. rst-class:: classref-method
  313. :ref:`float<class_float>` **get_time_to_next_mix** **(** **)** |const|
  314. Returns the relative time until the next mix occurs.
  315. .. rst-class:: classref-item-separator
  316. ----
  317. .. _class_AudioServer_method_is_bus_bypassing_effects:
  318. .. rst-class:: classref-method
  319. :ref:`bool<class_bool>` **is_bus_bypassing_effects** **(** :ref:`int<class_int>` bus_idx **)** |const|
  320. If ``true``, the bus at index ``bus_idx`` is bypassing effects.
  321. .. rst-class:: classref-item-separator
  322. ----
  323. .. _class_AudioServer_method_is_bus_effect_enabled:
  324. .. rst-class:: classref-method
  325. :ref:`bool<class_bool>` **is_bus_effect_enabled** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)** |const|
  326. If ``true``, the effect at index ``effect_idx`` on the bus at index ``bus_idx`` is enabled.
  327. .. rst-class:: classref-item-separator
  328. ----
  329. .. _class_AudioServer_method_is_bus_mute:
  330. .. rst-class:: classref-method
  331. :ref:`bool<class_bool>` **is_bus_mute** **(** :ref:`int<class_int>` bus_idx **)** |const|
  332. If ``true``, the bus at index ``bus_idx`` is muted.
  333. .. rst-class:: classref-item-separator
  334. ----
  335. .. _class_AudioServer_method_is_bus_solo:
  336. .. rst-class:: classref-method
  337. :ref:`bool<class_bool>` **is_bus_solo** **(** :ref:`int<class_int>` bus_idx **)** |const|
  338. If ``true``, the bus at index ``bus_idx`` is in solo mode.
  339. .. rst-class:: classref-item-separator
  340. ----
  341. .. _class_AudioServer_method_lock:
  342. .. rst-class:: classref-method
  343. void **lock** **(** **)**
  344. Locks the audio driver's main loop.
  345. \ **Note:** Remember to unlock it afterwards.
  346. .. rst-class:: classref-item-separator
  347. ----
  348. .. _class_AudioServer_method_move_bus:
  349. .. rst-class:: classref-method
  350. void **move_bus** **(** :ref:`int<class_int>` index, :ref:`int<class_int>` to_index **)**
  351. Moves the bus from index ``index`` to index ``to_index``.
  352. .. rst-class:: classref-item-separator
  353. ----
  354. .. _class_AudioServer_method_remove_bus:
  355. .. rst-class:: classref-method
  356. void **remove_bus** **(** :ref:`int<class_int>` index **)**
  357. Removes the bus at index ``index``.
  358. .. rst-class:: classref-item-separator
  359. ----
  360. .. _class_AudioServer_method_remove_bus_effect:
  361. .. rst-class:: classref-method
  362. void **remove_bus_effect** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx **)**
  363. Removes the effect at index ``effect_idx`` from the bus at index ``bus_idx``.
  364. .. rst-class:: classref-item-separator
  365. ----
  366. .. _class_AudioServer_method_set_bus_bypass_effects:
  367. .. rst-class:: classref-method
  368. void **set_bus_bypass_effects** **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)**
  369. If ``true``, the bus at index ``bus_idx`` is bypassing effects.
  370. .. rst-class:: classref-item-separator
  371. ----
  372. .. _class_AudioServer_method_set_bus_effect_enabled:
  373. .. rst-class:: classref-method
  374. void **set_bus_effect_enabled** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`bool<class_bool>` enabled **)**
  375. If ``true``, the effect at index ``effect_idx`` on the bus at index ``bus_idx`` is enabled.
  376. .. rst-class:: classref-item-separator
  377. ----
  378. .. _class_AudioServer_method_set_bus_layout:
  379. .. rst-class:: classref-method
  380. void **set_bus_layout** **(** :ref:`AudioBusLayout<class_AudioBusLayout>` bus_layout **)**
  381. Overwrites the currently used :ref:`AudioBusLayout<class_AudioBusLayout>`.
  382. .. rst-class:: classref-item-separator
  383. ----
  384. .. _class_AudioServer_method_set_bus_mute:
  385. .. rst-class:: classref-method
  386. void **set_bus_mute** **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)**
  387. If ``true``, the bus at index ``bus_idx`` is muted.
  388. .. rst-class:: classref-item-separator
  389. ----
  390. .. _class_AudioServer_method_set_bus_name:
  391. .. rst-class:: classref-method
  392. void **set_bus_name** **(** :ref:`int<class_int>` bus_idx, :ref:`String<class_String>` name **)**
  393. Sets the name of the bus at index ``bus_idx`` to ``name``.
  394. .. rst-class:: classref-item-separator
  395. ----
  396. .. _class_AudioServer_method_set_bus_send:
  397. .. rst-class:: classref-method
  398. void **set_bus_send** **(** :ref:`int<class_int>` bus_idx, :ref:`String<class_String>` send **)**
  399. Connects the output of the bus at ``bus_idx`` to the bus named ``send``.
  400. .. rst-class:: classref-item-separator
  401. ----
  402. .. _class_AudioServer_method_set_bus_solo:
  403. .. rst-class:: classref-method
  404. void **set_bus_solo** **(** :ref:`int<class_int>` bus_idx, :ref:`bool<class_bool>` enable **)**
  405. If ``true``, the bus at index ``bus_idx`` is in solo mode.
  406. .. rst-class:: classref-item-separator
  407. ----
  408. .. _class_AudioServer_method_set_bus_volume_db:
  409. .. rst-class:: classref-method
  410. void **set_bus_volume_db** **(** :ref:`int<class_int>` bus_idx, :ref:`float<class_float>` volume_db **)**
  411. Sets the volume of the bus at index ``bus_idx`` to ``volume_db``.
  412. .. rst-class:: classref-item-separator
  413. ----
  414. .. _class_AudioServer_method_swap_bus_effects:
  415. .. rst-class:: classref-method
  416. void **swap_bus_effects** **(** :ref:`int<class_int>` bus_idx, :ref:`int<class_int>` effect_idx, :ref:`int<class_int>` by_effect_idx **)**
  417. Swaps the position of two effects in bus ``bus_idx``.
  418. .. rst-class:: classref-item-separator
  419. ----
  420. .. _class_AudioServer_method_unlock:
  421. .. rst-class:: classref-method
  422. void **unlock** **(** **)**
  423. Unlocks the audio driver's main loop. (After locking it, you should always unlock it.)
  424. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  425. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  426. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  427. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`