class_audiostreamplayer3d.rst 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628
  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.5/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/AudioStreamPlayer3D.xml.
  6. .. _class_AudioStreamPlayer3D:
  7. AudioStreamPlayer3D
  8. ===================
  9. **Inherits:** :ref:`Spatial<class_Spatial>` **<** :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 a :ref:`Listener<class_Listener>` node to the scene and enabling it by calling :ref:`Listener.make_current<class_Listener_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:`unit_db<class_AudioStreamPlayer3D_property_unit_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:`../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:`String<class_String>` | :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:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` | :ref:`out_of_range_mode<class_AudioStreamPlayer3D_property_out_of_range_mode>` | ``0`` |
  53. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
  54. | :ref:`float<class_float>` | :ref:`pitch_scale<class_AudioStreamPlayer3D_property_pitch_scale>` | ``1.0`` |
  55. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
  56. | :ref:`bool<class_bool>` | :ref:`playing<class_AudioStreamPlayer3D_property_playing>` | ``false`` |
  57. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
  58. | :ref:`AudioStream<class_AudioStream>` | :ref:`stream<class_AudioStreamPlayer3D_property_stream>` | |
  59. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
  60. | :ref:`bool<class_bool>` | :ref:`stream_paused<class_AudioStreamPlayer3D_property_stream_paused>` | ``false`` |
  61. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
  62. | :ref:`float<class_float>` | :ref:`unit_db<class_AudioStreamPlayer3D_property_unit_db>` | ``0.0`` |
  63. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
  64. | :ref:`float<class_float>` | :ref:`unit_size<class_AudioStreamPlayer3D_property_unit_size>` | ``1.0`` |
  65. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
  66. .. rst-class:: classref-reftable-group
  67. Methods
  68. -------
  69. .. table::
  70. :widths: auto
  71. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  72. | :ref:`float<class_float>` | :ref:`get_playback_position<class_AudioStreamPlayer3D_method_get_playback_position>` **(** **)** |
  73. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  74. | :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` | :ref:`get_stream_playback<class_AudioStreamPlayer3D_method_get_stream_playback>` **(** **)** |
  75. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  76. | void | :ref:`play<class_AudioStreamPlayer3D_method_play>` **(** :ref:`float<class_float>` from_position=0.0 **)** |
  77. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  78. | void | :ref:`seek<class_AudioStreamPlayer3D_method_seek>` **(** :ref:`float<class_float>` to_position **)** |
  79. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  80. | void | :ref:`stop<class_AudioStreamPlayer3D_method_stop>` **(** **)** |
  81. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  82. .. rst-class:: classref-section-separator
  83. ----
  84. .. rst-class:: classref-descriptions-group
  85. Signals
  86. -------
  87. .. _class_AudioStreamPlayer3D_signal_finished:
  88. .. rst-class:: classref-signal
  89. **finished** **(** **)**
  90. Emitted when the audio stops playing.
  91. .. rst-class:: classref-section-separator
  92. ----
  93. .. rst-class:: classref-descriptions-group
  94. Enumerations
  95. ------------
  96. .. _enum_AudioStreamPlayer3D_AttenuationModel:
  97. .. rst-class:: classref-enumeration
  98. enum **AttenuationModel**:
  99. .. _class_AudioStreamPlayer3D_constant_ATTENUATION_INVERSE_DISTANCE:
  100. .. rst-class:: classref-enumeration-constant
  101. :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **ATTENUATION_INVERSE_DISTANCE** = ``0``
  102. Linear dampening of loudness according to distance.
  103. .. _class_AudioStreamPlayer3D_constant_ATTENUATION_INVERSE_SQUARE_DISTANCE:
  104. .. rst-class:: classref-enumeration-constant
  105. :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **ATTENUATION_INVERSE_SQUARE_DISTANCE** = ``1``
  106. Squared dampening of loudness according to distance.
  107. .. _class_AudioStreamPlayer3D_constant_ATTENUATION_LOGARITHMIC:
  108. .. rst-class:: classref-enumeration-constant
  109. :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **ATTENUATION_LOGARITHMIC** = ``2``
  110. Logarithmic dampening of loudness according to distance.
  111. .. _class_AudioStreamPlayer3D_constant_ATTENUATION_DISABLED:
  112. .. rst-class:: classref-enumeration-constant
  113. :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **ATTENUATION_DISABLED** = ``3``
  114. 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.
  115. .. rst-class:: classref-item-separator
  116. ----
  117. .. _enum_AudioStreamPlayer3D_OutOfRangeMode:
  118. .. rst-class:: classref-enumeration
  119. enum **OutOfRangeMode**:
  120. .. _class_AudioStreamPlayer3D_constant_OUT_OF_RANGE_MIX:
  121. .. rst-class:: classref-enumeration-constant
  122. :ref:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` **OUT_OF_RANGE_MIX** = ``0``
  123. Mix this audio in, even when it's out of range. This increases CPU usage, but keeps the sound playing at the correct position if the camera leaves and enters the **AudioStreamPlayer3D**'s :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` radius.
  124. .. _class_AudioStreamPlayer3D_constant_OUT_OF_RANGE_PAUSE:
  125. .. rst-class:: classref-enumeration-constant
  126. :ref:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` **OUT_OF_RANGE_PAUSE** = ``1``
  127. Pause this audio when it gets out of range. This decreases CPU usage, but will cause the sound to restart if the camera leaves and enters the **AudioStreamPlayer3D**'s :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` radius.
  128. .. rst-class:: classref-item-separator
  129. ----
  130. .. _enum_AudioStreamPlayer3D_DopplerTracking:
  131. .. rst-class:: classref-enumeration
  132. enum **DopplerTracking**:
  133. .. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_DISABLED:
  134. .. rst-class:: classref-enumeration-constant
  135. :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **DOPPLER_TRACKING_DISABLED** = ``0``
  136. Disables doppler tracking.
  137. .. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_IDLE_STEP:
  138. .. rst-class:: classref-enumeration-constant
  139. :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **DOPPLER_TRACKING_IDLE_STEP** = ``1``
  140. Executes doppler tracking in idle step (every rendered frame).
  141. .. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_PHYSICS_STEP:
  142. .. rst-class:: classref-enumeration-constant
  143. :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **DOPPLER_TRACKING_PHYSICS_STEP** = ``2``
  144. Executes doppler tracking in physics step (every simulated physics frame).
  145. .. rst-class:: classref-section-separator
  146. ----
  147. .. rst-class:: classref-descriptions-group
  148. Property Descriptions
  149. ---------------------
  150. .. _class_AudioStreamPlayer3D_property_area_mask:
  151. .. rst-class:: classref-property
  152. :ref:`int<class_int>` **area_mask** = ``1``
  153. .. rst-class:: classref-property-setget
  154. - void **set_area_mask** **(** :ref:`int<class_int>` value **)**
  155. - :ref:`int<class_int>` **get_area_mask** **(** **)**
  156. Determines which :ref:`Area<class_Area>` 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.
  157. .. rst-class:: classref-item-separator
  158. ----
  159. .. _class_AudioStreamPlayer3D_property_attenuation_filter_cutoff_hz:
  160. .. rst-class:: classref-property
  161. :ref:`float<class_float>` **attenuation_filter_cutoff_hz** = ``5000.0``
  162. .. rst-class:: classref-property-setget
  163. - void **set_attenuation_filter_cutoff_hz** **(** :ref:`float<class_float>` value **)**
  164. - :ref:`float<class_float>` **get_attenuation_filter_cutoff_hz** **(** **)**
  165. 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.
  166. .. rst-class:: classref-item-separator
  167. ----
  168. .. _class_AudioStreamPlayer3D_property_attenuation_filter_db:
  169. .. rst-class:: classref-property
  170. :ref:`float<class_float>` **attenuation_filter_db** = ``-24.0``
  171. .. rst-class:: classref-property-setget
  172. - void **set_attenuation_filter_db** **(** :ref:`float<class_float>` value **)**
  173. - :ref:`float<class_float>` **get_attenuation_filter_db** **(** **)**
  174. Amount how much the filter affects the loudness, in decibels.
  175. .. rst-class:: classref-item-separator
  176. ----
  177. .. _class_AudioStreamPlayer3D_property_attenuation_model:
  178. .. rst-class:: classref-property
  179. :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **attenuation_model** = ``0``
  180. .. rst-class:: classref-property-setget
  181. - void **set_attenuation_model** **(** :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` value **)**
  182. - :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **get_attenuation_model** **(** **)**
  183. Decides if audio should get quieter with distance linearly, quadratically, logarithmically, or not be affected by distance, effectively disabling attenuation.
  184. .. rst-class:: classref-item-separator
  185. ----
  186. .. _class_AudioStreamPlayer3D_property_autoplay:
  187. .. rst-class:: classref-property
  188. :ref:`bool<class_bool>` **autoplay** = ``false``
  189. .. rst-class:: classref-property-setget
  190. - void **set_autoplay** **(** :ref:`bool<class_bool>` value **)**
  191. - :ref:`bool<class_bool>` **is_autoplay_enabled** **(** **)**
  192. If ``true``, audio plays when the AudioStreamPlayer3D node is added to scene tree.
  193. .. rst-class:: classref-item-separator
  194. ----
  195. .. _class_AudioStreamPlayer3D_property_bus:
  196. .. rst-class:: classref-property
  197. :ref:`String<class_String>` **bus** = ``"Master"``
  198. .. rst-class:: classref-property-setget
  199. - void **set_bus** **(** :ref:`String<class_String>` value **)**
  200. - :ref:`String<class_String>` **get_bus** **(** **)**
  201. The bus on which this audio is playing.
  202. \ **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"``.
  203. .. rst-class:: classref-item-separator
  204. ----
  205. .. _class_AudioStreamPlayer3D_property_doppler_tracking:
  206. .. rst-class:: classref-property
  207. :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **doppler_tracking** = ``0``
  208. .. rst-class:: classref-property-setget
  209. - void **set_doppler_tracking** **(** :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` value **)**
  210. - :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **get_doppler_tracking** **(** **)**
  211. Decides in which step the `Doppler effect <https://en.wikipedia.org/wiki/Doppler_effect>`__ should be calculated.
  212. \ **Note:** Only effective if the current :ref:`Camera<class_Camera>`'s :ref:`Camera.doppler_tracking<class_Camera_property_doppler_tracking>` property is set to a value other than :ref:`Camera.DOPPLER_TRACKING_DISABLED<class_Camera_constant_DOPPLER_TRACKING_DISABLED>`.
  213. .. rst-class:: classref-item-separator
  214. ----
  215. .. _class_AudioStreamPlayer3D_property_emission_angle_degrees:
  216. .. rst-class:: classref-property
  217. :ref:`float<class_float>` **emission_angle_degrees** = ``45.0``
  218. .. rst-class:: classref-property-setget
  219. - void **set_emission_angle** **(** :ref:`float<class_float>` value **)**
  220. - :ref:`float<class_float>` **get_emission_angle** **(** **)**
  221. The angle in which the audio reaches cameras undampened.
  222. .. rst-class:: classref-item-separator
  223. ----
  224. .. _class_AudioStreamPlayer3D_property_emission_angle_enabled:
  225. .. rst-class:: classref-property
  226. :ref:`bool<class_bool>` **emission_angle_enabled** = ``false``
  227. .. rst-class:: classref-property-setget
  228. - void **set_emission_angle_enabled** **(** :ref:`bool<class_bool>` value **)**
  229. - :ref:`bool<class_bool>` **is_emission_angle_enabled** **(** **)**
  230. If ``true``, the audio should be dampened according to the direction of the sound.
  231. .. rst-class:: classref-item-separator
  232. ----
  233. .. _class_AudioStreamPlayer3D_property_emission_angle_filter_attenuation_db:
  234. .. rst-class:: classref-property
  235. :ref:`float<class_float>` **emission_angle_filter_attenuation_db** = ``-12.0``
  236. .. rst-class:: classref-property-setget
  237. - void **set_emission_angle_filter_attenuation_db** **(** :ref:`float<class_float>` value **)**
  238. - :ref:`float<class_float>` **get_emission_angle_filter_attenuation_db** **(** **)**
  239. 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.
  240. .. rst-class:: classref-item-separator
  241. ----
  242. .. _class_AudioStreamPlayer3D_property_max_db:
  243. .. rst-class:: classref-property
  244. :ref:`float<class_float>` **max_db** = ``3.0``
  245. .. rst-class:: classref-property-setget
  246. - void **set_max_db** **(** :ref:`float<class_float>` value **)**
  247. - :ref:`float<class_float>` **get_max_db** **(** **)**
  248. Sets the absolute maximum of the soundlevel, in decibels.
  249. .. rst-class:: classref-item-separator
  250. ----
  251. .. _class_AudioStreamPlayer3D_property_max_distance:
  252. .. rst-class:: classref-property
  253. :ref:`float<class_float>` **max_distance** = ``0.0``
  254. .. rst-class:: classref-property-setget
  255. - void **set_max_distance** **(** :ref:`float<class_float>` value **)**
  256. - :ref:`float<class_float>` **get_max_distance** **(** **)**
  257. Sets the distance from which the :ref:`out_of_range_mode<class_AudioStreamPlayer3D_property_out_of_range_mode>` takes effect. Has no effect if set to 0.
  258. .. rst-class:: classref-item-separator
  259. ----
  260. .. _class_AudioStreamPlayer3D_property_out_of_range_mode:
  261. .. rst-class:: classref-property
  262. :ref:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` **out_of_range_mode** = ``0``
  263. .. rst-class:: classref-property-setget
  264. - void **set_out_of_range_mode** **(** :ref:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` value **)**
  265. - :ref:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` **get_out_of_range_mode** **(** **)**
  266. Decides if audio should pause when source is outside of :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` range.
  267. .. rst-class:: classref-item-separator
  268. ----
  269. .. _class_AudioStreamPlayer3D_property_pitch_scale:
  270. .. rst-class:: classref-property
  271. :ref:`float<class_float>` **pitch_scale** = ``1.0``
  272. .. rst-class:: classref-property-setget
  273. - void **set_pitch_scale** **(** :ref:`float<class_float>` value **)**
  274. - :ref:`float<class_float>` **get_pitch_scale** **(** **)**
  275. The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.
  276. .. rst-class:: classref-item-separator
  277. ----
  278. .. _class_AudioStreamPlayer3D_property_playing:
  279. .. rst-class:: classref-property
  280. :ref:`bool<class_bool>` **playing** = ``false``
  281. .. rst-class:: classref-property-setget
  282. - :ref:`bool<class_bool>` **is_playing** **(** **)**
  283. If ``true``, audio is playing.
  284. .. rst-class:: classref-item-separator
  285. ----
  286. .. _class_AudioStreamPlayer3D_property_stream:
  287. .. rst-class:: classref-property
  288. :ref:`AudioStream<class_AudioStream>` **stream**
  289. .. rst-class:: classref-property-setget
  290. - void **set_stream** **(** :ref:`AudioStream<class_AudioStream>` value **)**
  291. - :ref:`AudioStream<class_AudioStream>` **get_stream** **(** **)**
  292. The :ref:`AudioStream<class_AudioStream>` resource to be played.
  293. .. rst-class:: classref-item-separator
  294. ----
  295. .. _class_AudioStreamPlayer3D_property_stream_paused:
  296. .. rst-class:: classref-property
  297. :ref:`bool<class_bool>` **stream_paused** = ``false``
  298. .. rst-class:: classref-property-setget
  299. - void **set_stream_paused** **(** :ref:`bool<class_bool>` value **)**
  300. - :ref:`bool<class_bool>` **get_stream_paused** **(** **)**
  301. If ``true``, the playback is paused. You can resume it by setting :ref:`stream_paused<class_AudioStreamPlayer3D_property_stream_paused>` to ``false``.
  302. .. rst-class:: classref-item-separator
  303. ----
  304. .. _class_AudioStreamPlayer3D_property_unit_db:
  305. .. rst-class:: classref-property
  306. :ref:`float<class_float>` **unit_db** = ``0.0``
  307. .. rst-class:: classref-property-setget
  308. - void **set_unit_db** **(** :ref:`float<class_float>` value **)**
  309. - :ref:`float<class_float>` **get_unit_db** **(** **)**
  310. The base sound level unaffected by dampening, in decibels.
  311. .. rst-class:: classref-item-separator
  312. ----
  313. .. _class_AudioStreamPlayer3D_property_unit_size:
  314. .. rst-class:: classref-property
  315. :ref:`float<class_float>` **unit_size** = ``1.0``
  316. .. rst-class:: classref-property-setget
  317. - void **set_unit_size** **(** :ref:`float<class_float>` value **)**
  318. - :ref:`float<class_float>` **get_unit_size** **(** **)**
  319. The factor for the attenuation effect. Higher values make the sound audible over a larger distance.
  320. .. rst-class:: classref-section-separator
  321. ----
  322. .. rst-class:: classref-descriptions-group
  323. Method Descriptions
  324. -------------------
  325. .. _class_AudioStreamPlayer3D_method_get_playback_position:
  326. .. rst-class:: classref-method
  327. :ref:`float<class_float>` **get_playback_position** **(** **)**
  328. Returns the position in the :ref:`AudioStream<class_AudioStream>`.
  329. .. rst-class:: classref-item-separator
  330. ----
  331. .. _class_AudioStreamPlayer3D_method_get_stream_playback:
  332. .. rst-class:: classref-method
  333. :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **get_stream_playback** **(** **)**
  334. Returns the :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` object associated with this **AudioStreamPlayer3D**.
  335. .. rst-class:: classref-item-separator
  336. ----
  337. .. _class_AudioStreamPlayer3D_method_play:
  338. .. rst-class:: classref-method
  339. void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
  340. Plays the audio from the given position ``from_position``, in seconds.
  341. .. rst-class:: classref-item-separator
  342. ----
  343. .. _class_AudioStreamPlayer3D_method_seek:
  344. .. rst-class:: classref-method
  345. void **seek** **(** :ref:`float<class_float>` to_position **)**
  346. Sets the position from which audio will be played, in seconds.
  347. .. rst-class:: classref-item-separator
  348. ----
  349. .. _class_AudioStreamPlayer3D_method_stop:
  350. .. rst-class:: classref-method
  351. void **stop** **(** **)**
  352. Stops the audio.
  353. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  354. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  355. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  356. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`