class_audiostreamplayer3d.rst 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636
  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/4.0/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.0/doc/classes/AudioStreamPlayer3D.xml.
  6. .. _class_AudioStreamPlayer3D:
  7. AudioStreamPlayer3D
  8. ===================
  9. **Inherits:** :ref:`Node3D<class_Node3D>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  10. Plays positional sound in 3D space.
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. Plays audio with positional sound effects, based on the relative position of the audio listener. Positional effects include distance attenuation, directionality, and the Doppler effect. For greater realism, a low-pass filter is applied to distant sounds. This can be disabled by setting :ref:`attenuation_filter_cutoff_hz<class_AudioStreamPlayer3D_property_attenuation_filter_cutoff_hz>` to ``20500``.
  15. By default, audio is heard from the camera position. This can be changed by adding an :ref:`AudioListener3D<class_AudioListener3D>` node to the scene and enabling it by calling :ref:`AudioListener3D.make_current<class_AudioListener3D_method_make_current>` on it.
  16. See also :ref:`AudioStreamPlayer<class_AudioStreamPlayer>` to play a sound non-positionally.
  17. \ **Note:** Hiding an **AudioStreamPlayer3D** node does not disable its audio output. To temporarily disable an **AudioStreamPlayer3D**'s audio output, set :ref:`volume_db<class_AudioStreamPlayer3D_property_volume_db>` to a very low value like ``-100`` (which isn't audible to human hearing).
  18. .. rst-class:: classref-introduction-group
  19. Tutorials
  20. ---------
  21. - :doc:`Audio streams <../tutorials/audio/audio_streams>`
  22. .. rst-class:: classref-reftable-group
  23. Properties
  24. ----------
  25. .. table::
  26. :widths: auto
  27. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
  28. | :ref:`int<class_int>` | :ref:`area_mask<class_AudioStreamPlayer3D_property_area_mask>` | ``1`` |
  29. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
  30. | :ref:`float<class_float>` | :ref:`attenuation_filter_cutoff_hz<class_AudioStreamPlayer3D_property_attenuation_filter_cutoff_hz>` | ``5000.0`` |
  31. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
  32. | :ref:`float<class_float>` | :ref:`attenuation_filter_db<class_AudioStreamPlayer3D_property_attenuation_filter_db>` | ``-24.0`` |
  33. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
  34. | :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` | :ref:`attenuation_model<class_AudioStreamPlayer3D_property_attenuation_model>` | ``0`` |
  35. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
  36. | :ref:`bool<class_bool>` | :ref:`autoplay<class_AudioStreamPlayer3D_property_autoplay>` | ``false`` |
  37. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
  38. | :ref:`StringName<class_StringName>` | :ref:`bus<class_AudioStreamPlayer3D_property_bus>` | ``&"Master"`` |
  39. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
  40. | :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` | :ref:`doppler_tracking<class_AudioStreamPlayer3D_property_doppler_tracking>` | ``0`` |
  41. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
  42. | :ref:`float<class_float>` | :ref:`emission_angle_degrees<class_AudioStreamPlayer3D_property_emission_angle_degrees>` | ``45.0`` |
  43. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
  44. | :ref:`bool<class_bool>` | :ref:`emission_angle_enabled<class_AudioStreamPlayer3D_property_emission_angle_enabled>` | ``false`` |
  45. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
  46. | :ref:`float<class_float>` | :ref:`emission_angle_filter_attenuation_db<class_AudioStreamPlayer3D_property_emission_angle_filter_attenuation_db>` | ``-12.0`` |
  47. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
  48. | :ref:`float<class_float>` | :ref:`max_db<class_AudioStreamPlayer3D_property_max_db>` | ``3.0`` |
  49. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
  50. | :ref:`float<class_float>` | :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` | ``0.0`` |
  51. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
  52. | :ref:`int<class_int>` | :ref:`max_polyphony<class_AudioStreamPlayer3D_property_max_polyphony>` | ``1`` |
  53. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
  54. | :ref:`float<class_float>` | :ref:`panning_strength<class_AudioStreamPlayer3D_property_panning_strength>` | ``1.0`` |
  55. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
  56. | :ref:`float<class_float>` | :ref:`pitch_scale<class_AudioStreamPlayer3D_property_pitch_scale>` | ``1.0`` |
  57. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
  58. | :ref:`bool<class_bool>` | :ref:`playing<class_AudioStreamPlayer3D_property_playing>` | ``false`` |
  59. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
  60. | :ref:`AudioStream<class_AudioStream>` | :ref:`stream<class_AudioStreamPlayer3D_property_stream>` | |
  61. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
  62. | :ref:`bool<class_bool>` | :ref:`stream_paused<class_AudioStreamPlayer3D_property_stream_paused>` | ``false`` |
  63. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
  64. | :ref:`float<class_float>` | :ref:`unit_size<class_AudioStreamPlayer3D_property_unit_size>` | ``10.0`` |
  65. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
  66. | :ref:`float<class_float>` | :ref:`volume_db<class_AudioStreamPlayer3D_property_volume_db>` | ``0.0`` |
  67. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+---------------+
  68. .. rst-class:: classref-reftable-group
  69. Methods
  70. -------
  71. .. table::
  72. :widths: auto
  73. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  74. | :ref:`float<class_float>` | :ref:`get_playback_position<class_AudioStreamPlayer3D_method_get_playback_position>` **(** **)** |
  75. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  76. | :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` | :ref:`get_stream_playback<class_AudioStreamPlayer3D_method_get_stream_playback>` **(** **)** |
  77. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  78. | :ref:`bool<class_bool>` | :ref:`has_stream_playback<class_AudioStreamPlayer3D_method_has_stream_playback>` **(** **)** |
  79. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  80. | void | :ref:`play<class_AudioStreamPlayer3D_method_play>` **(** :ref:`float<class_float>` from_position=0.0 **)** |
  81. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  82. | void | :ref:`seek<class_AudioStreamPlayer3D_method_seek>` **(** :ref:`float<class_float>` to_position **)** |
  83. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  84. | void | :ref:`stop<class_AudioStreamPlayer3D_method_stop>` **(** **)** |
  85. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  86. .. rst-class:: classref-section-separator
  87. ----
  88. .. rst-class:: classref-descriptions-group
  89. Signals
  90. -------
  91. .. _class_AudioStreamPlayer3D_signal_finished:
  92. .. rst-class:: classref-signal
  93. **finished** **(** **)**
  94. Emitted when the audio stops playing.
  95. .. rst-class:: classref-section-separator
  96. ----
  97. .. rst-class:: classref-descriptions-group
  98. Enumerations
  99. ------------
  100. .. _enum_AudioStreamPlayer3D_AttenuationModel:
  101. .. rst-class:: classref-enumeration
  102. enum **AttenuationModel**:
  103. .. _class_AudioStreamPlayer3D_constant_ATTENUATION_INVERSE_DISTANCE:
  104. .. rst-class:: classref-enumeration-constant
  105. :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **ATTENUATION_INVERSE_DISTANCE** = ``0``
  106. Attenuation of loudness according to linear distance.
  107. .. _class_AudioStreamPlayer3D_constant_ATTENUATION_INVERSE_SQUARE_DISTANCE:
  108. .. rst-class:: classref-enumeration-constant
  109. :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **ATTENUATION_INVERSE_SQUARE_DISTANCE** = ``1``
  110. Attenuation of loudness according to squared distance.
  111. .. _class_AudioStreamPlayer3D_constant_ATTENUATION_LOGARITHMIC:
  112. .. rst-class:: classref-enumeration-constant
  113. :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **ATTENUATION_LOGARITHMIC** = ``2``
  114. Attenuation of loudness according to logarithmic distance.
  115. .. _class_AudioStreamPlayer3D_constant_ATTENUATION_DISABLED:
  116. .. rst-class:: classref-enumeration-constant
  117. :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **ATTENUATION_DISABLED** = ``3``
  118. No attenuation of loudness according to distance. The sound will still be heard positionally, unlike an :ref:`AudioStreamPlayer<class_AudioStreamPlayer>`. :ref:`ATTENUATION_DISABLED<class_AudioStreamPlayer3D_constant_ATTENUATION_DISABLED>` can be combined with a :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` value greater than ``0.0`` to achieve linear attenuation clamped to a sphere of a defined size.
  119. .. rst-class:: classref-item-separator
  120. ----
  121. .. _enum_AudioStreamPlayer3D_DopplerTracking:
  122. .. rst-class:: classref-enumeration
  123. enum **DopplerTracking**:
  124. .. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_DISABLED:
  125. .. rst-class:: classref-enumeration-constant
  126. :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **DOPPLER_TRACKING_DISABLED** = ``0``
  127. Disables doppler tracking.
  128. .. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_IDLE_STEP:
  129. .. rst-class:: classref-enumeration-constant
  130. :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **DOPPLER_TRACKING_IDLE_STEP** = ``1``
  131. Executes doppler tracking in idle step.
  132. .. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_PHYSICS_STEP:
  133. .. rst-class:: classref-enumeration-constant
  134. :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **DOPPLER_TRACKING_PHYSICS_STEP** = ``2``
  135. Executes doppler tracking in physics step.
  136. .. rst-class:: classref-section-separator
  137. ----
  138. .. rst-class:: classref-descriptions-group
  139. Property Descriptions
  140. ---------------------
  141. .. _class_AudioStreamPlayer3D_property_area_mask:
  142. .. rst-class:: classref-property
  143. :ref:`int<class_int>` **area_mask** = ``1``
  144. .. rst-class:: classref-property-setget
  145. - void **set_area_mask** **(** :ref:`int<class_int>` value **)**
  146. - :ref:`int<class_int>` **get_area_mask** **(** **)**
  147. Determines which :ref:`Area3D<class_Area3D>` layers affect the sound for reverb and audio bus effects. Areas can be used to redirect :ref:`AudioStream<class_AudioStream>`\ s so that they play in a certain audio bus. An example of how you might use this is making a "water" area so that sounds played in the water are redirected through an audio bus to make them sound like they are being played underwater.
  148. .. rst-class:: classref-item-separator
  149. ----
  150. .. _class_AudioStreamPlayer3D_property_attenuation_filter_cutoff_hz:
  151. .. rst-class:: classref-property
  152. :ref:`float<class_float>` **attenuation_filter_cutoff_hz** = ``5000.0``
  153. .. rst-class:: classref-property-setget
  154. - void **set_attenuation_filter_cutoff_hz** **(** :ref:`float<class_float>` value **)**
  155. - :ref:`float<class_float>` **get_attenuation_filter_cutoff_hz** **(** **)**
  156. The cutoff frequency of the attenuation low-pass filter, in Hz. A sound above this frequency is attenuated more than a sound below this frequency. To disable this effect, set this to ``20500`` as this frequency is above the human hearing limit.
  157. .. rst-class:: classref-item-separator
  158. ----
  159. .. _class_AudioStreamPlayer3D_property_attenuation_filter_db:
  160. .. rst-class:: classref-property
  161. :ref:`float<class_float>` **attenuation_filter_db** = ``-24.0``
  162. .. rst-class:: classref-property-setget
  163. - void **set_attenuation_filter_db** **(** :ref:`float<class_float>` value **)**
  164. - :ref:`float<class_float>` **get_attenuation_filter_db** **(** **)**
  165. Amount how much the filter affects the loudness, in decibels.
  166. .. rst-class:: classref-item-separator
  167. ----
  168. .. _class_AudioStreamPlayer3D_property_attenuation_model:
  169. .. rst-class:: classref-property
  170. :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **attenuation_model** = ``0``
  171. .. rst-class:: classref-property-setget
  172. - void **set_attenuation_model** **(** :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` value **)**
  173. - :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **get_attenuation_model** **(** **)**
  174. Decides if audio should get quieter with distance linearly, quadratically, logarithmically, or not be affected by distance, effectively disabling attenuation.
  175. .. rst-class:: classref-item-separator
  176. ----
  177. .. _class_AudioStreamPlayer3D_property_autoplay:
  178. .. rst-class:: classref-property
  179. :ref:`bool<class_bool>` **autoplay** = ``false``
  180. .. rst-class:: classref-property-setget
  181. - void **set_autoplay** **(** :ref:`bool<class_bool>` value **)**
  182. - :ref:`bool<class_bool>` **is_autoplay_enabled** **(** **)**
  183. If ``true``, audio plays when the AudioStreamPlayer3D node is added to scene tree.
  184. .. rst-class:: classref-item-separator
  185. ----
  186. .. _class_AudioStreamPlayer3D_property_bus:
  187. .. rst-class:: classref-property
  188. :ref:`StringName<class_StringName>` **bus** = ``&"Master"``
  189. .. rst-class:: classref-property-setget
  190. - void **set_bus** **(** :ref:`StringName<class_StringName>` value **)**
  191. - :ref:`StringName<class_StringName>` **get_bus** **(** **)**
  192. The bus on which this audio is playing.
  193. \ **Note:** When setting this property, keep in mind that no validation is performed to see if the given name matches an existing bus. This is because audio bus layouts might be loaded after this property is set. If this given name can't be resolved at runtime, it will fall back to ``"Master"``.
  194. .. rst-class:: classref-item-separator
  195. ----
  196. .. _class_AudioStreamPlayer3D_property_doppler_tracking:
  197. .. rst-class:: classref-property
  198. :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **doppler_tracking** = ``0``
  199. .. rst-class:: classref-property-setget
  200. - void **set_doppler_tracking** **(** :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` value **)**
  201. - :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **get_doppler_tracking** **(** **)**
  202. Decides in which step the Doppler effect should be calculated.
  203. .. rst-class:: classref-item-separator
  204. ----
  205. .. _class_AudioStreamPlayer3D_property_emission_angle_degrees:
  206. .. rst-class:: classref-property
  207. :ref:`float<class_float>` **emission_angle_degrees** = ``45.0``
  208. .. rst-class:: classref-property-setget
  209. - void **set_emission_angle** **(** :ref:`float<class_float>` value **)**
  210. - :ref:`float<class_float>` **get_emission_angle** **(** **)**
  211. The angle in which the audio reaches a listener unattenuated.
  212. .. rst-class:: classref-item-separator
  213. ----
  214. .. _class_AudioStreamPlayer3D_property_emission_angle_enabled:
  215. .. rst-class:: classref-property
  216. :ref:`bool<class_bool>` **emission_angle_enabled** = ``false``
  217. .. rst-class:: classref-property-setget
  218. - void **set_emission_angle_enabled** **(** :ref:`bool<class_bool>` value **)**
  219. - :ref:`bool<class_bool>` **is_emission_angle_enabled** **(** **)**
  220. If ``true``, the audio should be attenuated according to the direction of the sound.
  221. .. rst-class:: classref-item-separator
  222. ----
  223. .. _class_AudioStreamPlayer3D_property_emission_angle_filter_attenuation_db:
  224. .. rst-class:: classref-property
  225. :ref:`float<class_float>` **emission_angle_filter_attenuation_db** = ``-12.0``
  226. .. rst-class:: classref-property-setget
  227. - void **set_emission_angle_filter_attenuation_db** **(** :ref:`float<class_float>` value **)**
  228. - :ref:`float<class_float>` **get_emission_angle_filter_attenuation_db** **(** **)**
  229. Attenuation factor used if listener is outside of :ref:`emission_angle_degrees<class_AudioStreamPlayer3D_property_emission_angle_degrees>` and :ref:`emission_angle_enabled<class_AudioStreamPlayer3D_property_emission_angle_enabled>` is set, in decibels.
  230. .. rst-class:: classref-item-separator
  231. ----
  232. .. _class_AudioStreamPlayer3D_property_max_db:
  233. .. rst-class:: classref-property
  234. :ref:`float<class_float>` **max_db** = ``3.0``
  235. .. rst-class:: classref-property-setget
  236. - void **set_max_db** **(** :ref:`float<class_float>` value **)**
  237. - :ref:`float<class_float>` **get_max_db** **(** **)**
  238. Sets the absolute maximum of the soundlevel, in decibels.
  239. .. rst-class:: classref-item-separator
  240. ----
  241. .. _class_AudioStreamPlayer3D_property_max_distance:
  242. .. rst-class:: classref-property
  243. :ref:`float<class_float>` **max_distance** = ``0.0``
  244. .. rst-class:: classref-property-setget
  245. - void **set_max_distance** **(** :ref:`float<class_float>` value **)**
  246. - :ref:`float<class_float>` **get_max_distance** **(** **)**
  247. The distance past which the sound can no longer be heard at all. Only has an effect if set to a value greater than ``0.0``. :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` works in tandem with :ref:`unit_size<class_AudioStreamPlayer3D_property_unit_size>`. However, unlike :ref:`unit_size<class_AudioStreamPlayer3D_property_unit_size>` whose behavior depends on the :ref:`attenuation_model<class_AudioStreamPlayer3D_property_attenuation_model>`, :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` always works in a linear fashion. This can be used to prevent the **AudioStreamPlayer3D** from requiring audio mixing when the listener is far away, which saves CPU resources.
  248. .. rst-class:: classref-item-separator
  249. ----
  250. .. _class_AudioStreamPlayer3D_property_max_polyphony:
  251. .. rst-class:: classref-property
  252. :ref:`int<class_int>` **max_polyphony** = ``1``
  253. .. rst-class:: classref-property-setget
  254. - void **set_max_polyphony** **(** :ref:`int<class_int>` value **)**
  255. - :ref:`int<class_int>` **get_max_polyphony** **(** **)**
  256. The maximum number of sounds this node can play at the same time. Playing additional sounds after this value is reached will cut off the oldest sounds.
  257. .. rst-class:: classref-item-separator
  258. ----
  259. .. _class_AudioStreamPlayer3D_property_panning_strength:
  260. .. rst-class:: classref-property
  261. :ref:`float<class_float>` **panning_strength** = ``1.0``
  262. .. rst-class:: classref-property-setget
  263. - void **set_panning_strength** **(** :ref:`float<class_float>` value **)**
  264. - :ref:`float<class_float>` **get_panning_strength** **(** **)**
  265. Scales the panning strength for this node by multiplying the base :ref:`ProjectSettings.audio/general/3d_panning_strength<class_ProjectSettings_property_audio/general/3d_panning_strength>` with this factor. Higher values will pan audio from left to right more dramatically than lower values.
  266. .. rst-class:: classref-item-separator
  267. ----
  268. .. _class_AudioStreamPlayer3D_property_pitch_scale:
  269. .. rst-class:: classref-property
  270. :ref:`float<class_float>` **pitch_scale** = ``1.0``
  271. .. rst-class:: classref-property-setget
  272. - void **set_pitch_scale** **(** :ref:`float<class_float>` value **)**
  273. - :ref:`float<class_float>` **get_pitch_scale** **(** **)**
  274. The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.
  275. .. rst-class:: classref-item-separator
  276. ----
  277. .. _class_AudioStreamPlayer3D_property_playing:
  278. .. rst-class:: classref-property
  279. :ref:`bool<class_bool>` **playing** = ``false``
  280. .. rst-class:: classref-property-setget
  281. - :ref:`bool<class_bool>` **is_playing** **(** **)**
  282. If ``true``, audio is playing or is queued to be played (see :ref:`play<class_AudioStreamPlayer3D_method_play>`).
  283. .. rst-class:: classref-item-separator
  284. ----
  285. .. _class_AudioStreamPlayer3D_property_stream:
  286. .. rst-class:: classref-property
  287. :ref:`AudioStream<class_AudioStream>` **stream**
  288. .. rst-class:: classref-property-setget
  289. - void **set_stream** **(** :ref:`AudioStream<class_AudioStream>` value **)**
  290. - :ref:`AudioStream<class_AudioStream>` **get_stream** **(** **)**
  291. The :ref:`AudioStream<class_AudioStream>` resource to be played.
  292. .. rst-class:: classref-item-separator
  293. ----
  294. .. _class_AudioStreamPlayer3D_property_stream_paused:
  295. .. rst-class:: classref-property
  296. :ref:`bool<class_bool>` **stream_paused** = ``false``
  297. .. rst-class:: classref-property-setget
  298. - void **set_stream_paused** **(** :ref:`bool<class_bool>` value **)**
  299. - :ref:`bool<class_bool>` **get_stream_paused** **(** **)**
  300. If ``true``, the playback is paused. You can resume it by setting :ref:`stream_paused<class_AudioStreamPlayer3D_property_stream_paused>` to ``false``.
  301. .. rst-class:: classref-item-separator
  302. ----
  303. .. _class_AudioStreamPlayer3D_property_unit_size:
  304. .. rst-class:: classref-property
  305. :ref:`float<class_float>` **unit_size** = ``10.0``
  306. .. rst-class:: classref-property-setget
  307. - void **set_unit_size** **(** :ref:`float<class_float>` value **)**
  308. - :ref:`float<class_float>` **get_unit_size** **(** **)**
  309. The factor for the attenuation effect. Higher values make the sound audible over a larger distance.
  310. .. rst-class:: classref-item-separator
  311. ----
  312. .. _class_AudioStreamPlayer3D_property_volume_db:
  313. .. rst-class:: classref-property
  314. :ref:`float<class_float>` **volume_db** = ``0.0``
  315. .. rst-class:: classref-property-setget
  316. - void **set_volume_db** **(** :ref:`float<class_float>` value **)**
  317. - :ref:`float<class_float>` **get_volume_db** **(** **)**
  318. The base sound level before attenuation, in decibels.
  319. .. rst-class:: classref-section-separator
  320. ----
  321. .. rst-class:: classref-descriptions-group
  322. Method Descriptions
  323. -------------------
  324. .. _class_AudioStreamPlayer3D_method_get_playback_position:
  325. .. rst-class:: classref-method
  326. :ref:`float<class_float>` **get_playback_position** **(** **)**
  327. Returns the position in the :ref:`AudioStream<class_AudioStream>`.
  328. .. rst-class:: classref-item-separator
  329. ----
  330. .. _class_AudioStreamPlayer3D_method_get_stream_playback:
  331. .. rst-class:: classref-method
  332. :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **get_stream_playback** **(** **)**
  333. Returns the :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` object associated with this **AudioStreamPlayer3D**.
  334. .. rst-class:: classref-item-separator
  335. ----
  336. .. _class_AudioStreamPlayer3D_method_has_stream_playback:
  337. .. rst-class:: classref-method
  338. :ref:`bool<class_bool>` **has_stream_playback** **(** **)**
  339. Returns whether the :ref:`AudioStreamPlayer<class_AudioStreamPlayer>` can return the :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` object or not.
  340. .. rst-class:: classref-item-separator
  341. ----
  342. .. _class_AudioStreamPlayer3D_method_play:
  343. .. rst-class:: classref-method
  344. void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
  345. Queues the audio to play on the next physics frame, from the given position ``from_position``, in seconds.
  346. .. rst-class:: classref-item-separator
  347. ----
  348. .. _class_AudioStreamPlayer3D_method_seek:
  349. .. rst-class:: classref-method
  350. void **seek** **(** :ref:`float<class_float>` to_position **)**
  351. Sets the position from which audio will be played, in seconds.
  352. .. rst-class:: classref-item-separator
  353. ----
  354. .. _class_AudioStreamPlayer3D_method_stop:
  355. .. rst-class:: classref-method
  356. void **stop** **(** **)**
  357. Stops the audio.
  358. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  359. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  360. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  361. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  362. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  363. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`