class_audiostreamplayer3d.rst 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/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 a sound effect with directed sound effects, dampens with distance if needed, generates effect of hearable position in space. For greater realism, a low-pass filter is automatically 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. | void | :ref:`play<class_AudioStreamPlayer3D_method_play>` **(** :ref:`float<class_float>` from_position=0.0 **)** |
  79. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  80. | void | :ref:`seek<class_AudioStreamPlayer3D_method_seek>` **(** :ref:`float<class_float>` to_position **)** |
  81. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  82. | void | :ref:`stop<class_AudioStreamPlayer3D_method_stop>` **(** **)** |
  83. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  84. .. rst-class:: classref-section-separator
  85. ----
  86. .. rst-class:: classref-descriptions-group
  87. Signals
  88. -------
  89. .. _class_AudioStreamPlayer3D_signal_finished:
  90. .. rst-class:: classref-signal
  91. **finished** **(** **)**
  92. Emitted when the audio stops playing.
  93. .. rst-class:: classref-section-separator
  94. ----
  95. .. rst-class:: classref-descriptions-group
  96. Enumerations
  97. ------------
  98. .. _enum_AudioStreamPlayer3D_AttenuationModel:
  99. .. rst-class:: classref-enumeration
  100. enum **AttenuationModel**:
  101. .. _class_AudioStreamPlayer3D_constant_ATTENUATION_INVERSE_DISTANCE:
  102. .. rst-class:: classref-enumeration-constant
  103. :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **ATTENUATION_INVERSE_DISTANCE** = ``0``
  104. Linear dampening of loudness according to distance.
  105. .. _class_AudioStreamPlayer3D_constant_ATTENUATION_INVERSE_SQUARE_DISTANCE:
  106. .. rst-class:: classref-enumeration-constant
  107. :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **ATTENUATION_INVERSE_SQUARE_DISTANCE** = ``1``
  108. Squared dampening of loudness according to distance.
  109. .. _class_AudioStreamPlayer3D_constant_ATTENUATION_LOGARITHMIC:
  110. .. rst-class:: classref-enumeration-constant
  111. :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **ATTENUATION_LOGARITHMIC** = ``2``
  112. Logarithmic dampening of loudness according to distance.
  113. .. _class_AudioStreamPlayer3D_constant_ATTENUATION_DISABLED:
  114. .. rst-class:: classref-enumeration-constant
  115. :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **ATTENUATION_DISABLED** = ``3``
  116. No dampening 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.
  117. .. rst-class:: classref-item-separator
  118. ----
  119. .. _enum_AudioStreamPlayer3D_DopplerTracking:
  120. .. rst-class:: classref-enumeration
  121. enum **DopplerTracking**:
  122. .. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_DISABLED:
  123. .. rst-class:: classref-enumeration-constant
  124. :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **DOPPLER_TRACKING_DISABLED** = ``0``
  125. Disables doppler tracking.
  126. .. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_IDLE_STEP:
  127. .. rst-class:: classref-enumeration-constant
  128. :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **DOPPLER_TRACKING_IDLE_STEP** = ``1``
  129. Executes doppler tracking in idle step.
  130. .. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_PHYSICS_STEP:
  131. .. rst-class:: classref-enumeration-constant
  132. :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **DOPPLER_TRACKING_PHYSICS_STEP** = ``2``
  133. Executes doppler tracking in physics step.
  134. .. rst-class:: classref-section-separator
  135. ----
  136. .. rst-class:: classref-descriptions-group
  137. Property Descriptions
  138. ---------------------
  139. .. _class_AudioStreamPlayer3D_property_area_mask:
  140. .. rst-class:: classref-property
  141. :ref:`int<class_int>` **area_mask** = ``1``
  142. .. rst-class:: classref-property-setget
  143. - void **set_area_mask** **(** :ref:`int<class_int>` value **)**
  144. - :ref:`int<class_int>` **get_area_mask** **(** **)**
  145. 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.
  146. .. rst-class:: classref-item-separator
  147. ----
  148. .. _class_AudioStreamPlayer3D_property_attenuation_filter_cutoff_hz:
  149. .. rst-class:: classref-property
  150. :ref:`float<class_float>` **attenuation_filter_cutoff_hz** = ``5000.0``
  151. .. rst-class:: classref-property-setget
  152. - void **set_attenuation_filter_cutoff_hz** **(** :ref:`float<class_float>` value **)**
  153. - :ref:`float<class_float>` **get_attenuation_filter_cutoff_hz** **(** **)**
  154. Dampens audio using a low-pass filter above this frequency, in Hz. To disable the dampening effect entirely, set this to ``20500`` as this frequency is above the human hearing limit.
  155. .. rst-class:: classref-item-separator
  156. ----
  157. .. _class_AudioStreamPlayer3D_property_attenuation_filter_db:
  158. .. rst-class:: classref-property
  159. :ref:`float<class_float>` **attenuation_filter_db** = ``-24.0``
  160. .. rst-class:: classref-property-setget
  161. - void **set_attenuation_filter_db** **(** :ref:`float<class_float>` value **)**
  162. - :ref:`float<class_float>` **get_attenuation_filter_db** **(** **)**
  163. Amount how much the filter affects the loudness, in decibels.
  164. .. rst-class:: classref-item-separator
  165. ----
  166. .. _class_AudioStreamPlayer3D_property_attenuation_model:
  167. .. rst-class:: classref-property
  168. :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **attenuation_model** = ``0``
  169. .. rst-class:: classref-property-setget
  170. - void **set_attenuation_model** **(** :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` value **)**
  171. - :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **get_attenuation_model** **(** **)**
  172. Decides if audio should get quieter with distance linearly, quadratically, logarithmically, or not be affected by distance, effectively disabling attenuation.
  173. .. rst-class:: classref-item-separator
  174. ----
  175. .. _class_AudioStreamPlayer3D_property_autoplay:
  176. .. rst-class:: classref-property
  177. :ref:`bool<class_bool>` **autoplay** = ``false``
  178. .. rst-class:: classref-property-setget
  179. - void **set_autoplay** **(** :ref:`bool<class_bool>` value **)**
  180. - :ref:`bool<class_bool>` **is_autoplay_enabled** **(** **)**
  181. If ``true``, audio plays when the AudioStreamPlayer3D node is added to scene tree.
  182. .. rst-class:: classref-item-separator
  183. ----
  184. .. _class_AudioStreamPlayer3D_property_bus:
  185. .. rst-class:: classref-property
  186. :ref:`StringName<class_StringName>` **bus** = ``&"Master"``
  187. .. rst-class:: classref-property-setget
  188. - void **set_bus** **(** :ref:`StringName<class_StringName>` value **)**
  189. - :ref:`StringName<class_StringName>` **get_bus** **(** **)**
  190. The bus on which this audio is playing.
  191. \ **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"``.
  192. .. rst-class:: classref-item-separator
  193. ----
  194. .. _class_AudioStreamPlayer3D_property_doppler_tracking:
  195. .. rst-class:: classref-property
  196. :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **doppler_tracking** = ``0``
  197. .. rst-class:: classref-property-setget
  198. - void **set_doppler_tracking** **(** :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` value **)**
  199. - :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **get_doppler_tracking** **(** **)**
  200. Decides in which step the Doppler effect should be calculated.
  201. .. rst-class:: classref-item-separator
  202. ----
  203. .. _class_AudioStreamPlayer3D_property_emission_angle_degrees:
  204. .. rst-class:: classref-property
  205. :ref:`float<class_float>` **emission_angle_degrees** = ``45.0``
  206. .. rst-class:: classref-property-setget
  207. - void **set_emission_angle** **(** :ref:`float<class_float>` value **)**
  208. - :ref:`float<class_float>` **get_emission_angle** **(** **)**
  209. The angle in which the audio reaches cameras undampened.
  210. .. rst-class:: classref-item-separator
  211. ----
  212. .. _class_AudioStreamPlayer3D_property_emission_angle_enabled:
  213. .. rst-class:: classref-property
  214. :ref:`bool<class_bool>` **emission_angle_enabled** = ``false``
  215. .. rst-class:: classref-property-setget
  216. - void **set_emission_angle_enabled** **(** :ref:`bool<class_bool>` value **)**
  217. - :ref:`bool<class_bool>` **is_emission_angle_enabled** **(** **)**
  218. If ``true``, the audio should be dampened according to the direction of the sound.
  219. .. rst-class:: classref-item-separator
  220. ----
  221. .. _class_AudioStreamPlayer3D_property_emission_angle_filter_attenuation_db:
  222. .. rst-class:: classref-property
  223. :ref:`float<class_float>` **emission_angle_filter_attenuation_db** = ``-12.0``
  224. .. rst-class:: classref-property-setget
  225. - void **set_emission_angle_filter_attenuation_db** **(** :ref:`float<class_float>` value **)**
  226. - :ref:`float<class_float>` **get_emission_angle_filter_attenuation_db** **(** **)**
  227. Dampens audio if camera 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 by this factor, in decibels.
  228. .. rst-class:: classref-item-separator
  229. ----
  230. .. _class_AudioStreamPlayer3D_property_max_db:
  231. .. rst-class:: classref-property
  232. :ref:`float<class_float>` **max_db** = ``3.0``
  233. .. rst-class:: classref-property-setget
  234. - void **set_max_db** **(** :ref:`float<class_float>` value **)**
  235. - :ref:`float<class_float>` **get_max_db** **(** **)**
  236. Sets the absolute maximum of the soundlevel, in decibels.
  237. .. rst-class:: classref-item-separator
  238. ----
  239. .. _class_AudioStreamPlayer3D_property_max_distance:
  240. .. rst-class:: classref-property
  241. :ref:`float<class_float>` **max_distance** = ``0.0``
  242. .. rst-class:: classref-property-setget
  243. - void **set_max_distance** **(** :ref:`float<class_float>` value **)**
  244. - :ref:`float<class_float>` **get_max_distance** **(** **)**
  245. 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.
  246. .. rst-class:: classref-item-separator
  247. ----
  248. .. _class_AudioStreamPlayer3D_property_max_polyphony:
  249. .. rst-class:: classref-property
  250. :ref:`int<class_int>` **max_polyphony** = ``1``
  251. .. rst-class:: classref-property-setget
  252. - void **set_max_polyphony** **(** :ref:`int<class_int>` value **)**
  253. - :ref:`int<class_int>` **get_max_polyphony** **(** **)**
  254. 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.
  255. .. rst-class:: classref-item-separator
  256. ----
  257. .. _class_AudioStreamPlayer3D_property_panning_strength:
  258. .. rst-class:: classref-property
  259. :ref:`float<class_float>` **panning_strength** = ``1.0``
  260. .. rst-class:: classref-property-setget
  261. - void **set_panning_strength** **(** :ref:`float<class_float>` value **)**
  262. - :ref:`float<class_float>` **get_panning_strength** **(** **)**
  263. 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.
  264. .. rst-class:: classref-item-separator
  265. ----
  266. .. _class_AudioStreamPlayer3D_property_pitch_scale:
  267. .. rst-class:: classref-property
  268. :ref:`float<class_float>` **pitch_scale** = ``1.0``
  269. .. rst-class:: classref-property-setget
  270. - void **set_pitch_scale** **(** :ref:`float<class_float>` value **)**
  271. - :ref:`float<class_float>` **get_pitch_scale** **(** **)**
  272. The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.
  273. .. rst-class:: classref-item-separator
  274. ----
  275. .. _class_AudioStreamPlayer3D_property_playing:
  276. .. rst-class:: classref-property
  277. :ref:`bool<class_bool>` **playing** = ``false``
  278. .. rst-class:: classref-property-setget
  279. - :ref:`bool<class_bool>` **is_playing** **(** **)**
  280. If ``true``, audio is playing or is queued to be played (see :ref:`play<class_AudioStreamPlayer3D_method_play>`).
  281. .. rst-class:: classref-item-separator
  282. ----
  283. .. _class_AudioStreamPlayer3D_property_stream:
  284. .. rst-class:: classref-property
  285. :ref:`AudioStream<class_AudioStream>` **stream**
  286. .. rst-class:: classref-property-setget
  287. - void **set_stream** **(** :ref:`AudioStream<class_AudioStream>` value **)**
  288. - :ref:`AudioStream<class_AudioStream>` **get_stream** **(** **)**
  289. The :ref:`AudioStream<class_AudioStream>` resource to be played.
  290. .. rst-class:: classref-item-separator
  291. ----
  292. .. _class_AudioStreamPlayer3D_property_stream_paused:
  293. .. rst-class:: classref-property
  294. :ref:`bool<class_bool>` **stream_paused** = ``false``
  295. .. rst-class:: classref-property-setget
  296. - void **set_stream_paused** **(** :ref:`bool<class_bool>` value **)**
  297. - :ref:`bool<class_bool>` **get_stream_paused** **(** **)**
  298. If ``true``, the playback is paused. You can resume it by setting :ref:`stream_paused<class_AudioStreamPlayer3D_property_stream_paused>` to ``false``.
  299. .. rst-class:: classref-item-separator
  300. ----
  301. .. _class_AudioStreamPlayer3D_property_unit_size:
  302. .. rst-class:: classref-property
  303. :ref:`float<class_float>` **unit_size** = ``10.0``
  304. .. rst-class:: classref-property-setget
  305. - void **set_unit_size** **(** :ref:`float<class_float>` value **)**
  306. - :ref:`float<class_float>` **get_unit_size** **(** **)**
  307. The factor for the attenuation effect. Higher values make the sound audible over a larger distance.
  308. .. rst-class:: classref-item-separator
  309. ----
  310. .. _class_AudioStreamPlayer3D_property_volume_db:
  311. .. rst-class:: classref-property
  312. :ref:`float<class_float>` **volume_db** = ``0.0``
  313. .. rst-class:: classref-property-setget
  314. - void **set_volume_db** **(** :ref:`float<class_float>` value **)**
  315. - :ref:`float<class_float>` **get_volume_db** **(** **)**
  316. The base sound level unaffected by dampening, in decibels.
  317. .. rst-class:: classref-section-separator
  318. ----
  319. .. rst-class:: classref-descriptions-group
  320. Method Descriptions
  321. -------------------
  322. .. _class_AudioStreamPlayer3D_method_get_playback_position:
  323. .. rst-class:: classref-method
  324. :ref:`float<class_float>` **get_playback_position** **(** **)**
  325. Returns the position in the :ref:`AudioStream<class_AudioStream>`.
  326. .. rst-class:: classref-item-separator
  327. ----
  328. .. _class_AudioStreamPlayer3D_method_get_stream_playback:
  329. .. rst-class:: classref-method
  330. :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **get_stream_playback** **(** **)**
  331. Returns the :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` object associated with this **AudioStreamPlayer3D**.
  332. .. rst-class:: classref-item-separator
  333. ----
  334. .. _class_AudioStreamPlayer3D_method_play:
  335. .. rst-class:: classref-method
  336. void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
  337. Queues the audio to play on the next physics frame, from the given position ``from_position``, in seconds.
  338. .. rst-class:: classref-item-separator
  339. ----
  340. .. _class_AudioStreamPlayer3D_method_seek:
  341. .. rst-class:: classref-method
  342. void **seek** **(** :ref:`float<class_float>` to_position **)**
  343. Sets the position from which audio will be played, in seconds.
  344. .. rst-class:: classref-item-separator
  345. ----
  346. .. _class_AudioStreamPlayer3D_method_stop:
  347. .. rst-class:: classref-method
  348. void **stop** **(** **)**
  349. Stops the audio.
  350. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  351. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  352. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  353. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  354. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  355. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`