class_audiostreamplayer3d.rst 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647
  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/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:`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_db<class_AudioStreamPlayer3D_property_unit_db>` | ``0.0`` |
  65. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+--------------+
  66. | :ref:`float<class_float>` | :ref:`unit_size<class_AudioStreamPlayer3D_property_unit_size>` | ``1.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_OutOfRangeMode:
  120. .. rst-class:: classref-enumeration
  121. enum **OutOfRangeMode**:
  122. .. _class_AudioStreamPlayer3D_constant_OUT_OF_RANGE_MIX:
  123. .. rst-class:: classref-enumeration-constant
  124. :ref:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` **OUT_OF_RANGE_MIX** = ``0``
  125. 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.
  126. .. _class_AudioStreamPlayer3D_constant_OUT_OF_RANGE_PAUSE:
  127. .. rst-class:: classref-enumeration-constant
  128. :ref:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` **OUT_OF_RANGE_PAUSE** = ``1``
  129. 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.
  130. .. rst-class:: classref-item-separator
  131. ----
  132. .. _enum_AudioStreamPlayer3D_DopplerTracking:
  133. .. rst-class:: classref-enumeration
  134. enum **DopplerTracking**:
  135. .. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_DISABLED:
  136. .. rst-class:: classref-enumeration-constant
  137. :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **DOPPLER_TRACKING_DISABLED** = ``0``
  138. Disables doppler tracking.
  139. .. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_IDLE_STEP:
  140. .. rst-class:: classref-enumeration-constant
  141. :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **DOPPLER_TRACKING_IDLE_STEP** = ``1``
  142. Executes doppler tracking in idle step (every rendered frame).
  143. .. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_PHYSICS_STEP:
  144. .. rst-class:: classref-enumeration-constant
  145. :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **DOPPLER_TRACKING_PHYSICS_STEP** = ``2``
  146. Executes doppler tracking in physics step (every simulated physics frame).
  147. .. rst-class:: classref-section-separator
  148. ----
  149. .. rst-class:: classref-descriptions-group
  150. Property Descriptions
  151. ---------------------
  152. .. _class_AudioStreamPlayer3D_property_area_mask:
  153. .. rst-class:: classref-property
  154. :ref:`int<class_int>` **area_mask** = ``1``
  155. .. rst-class:: classref-property-setget
  156. - void **set_area_mask** **(** :ref:`int<class_int>` value **)**
  157. - :ref:`int<class_int>` **get_area_mask** **(** **)**
  158. 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.
  159. .. rst-class:: classref-item-separator
  160. ----
  161. .. _class_AudioStreamPlayer3D_property_attenuation_filter_cutoff_hz:
  162. .. rst-class:: classref-property
  163. :ref:`float<class_float>` **attenuation_filter_cutoff_hz** = ``5000.0``
  164. .. rst-class:: classref-property-setget
  165. - void **set_attenuation_filter_cutoff_hz** **(** :ref:`float<class_float>` value **)**
  166. - :ref:`float<class_float>` **get_attenuation_filter_cutoff_hz** **(** **)**
  167. 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.
  168. .. rst-class:: classref-item-separator
  169. ----
  170. .. _class_AudioStreamPlayer3D_property_attenuation_filter_db:
  171. .. rst-class:: classref-property
  172. :ref:`float<class_float>` **attenuation_filter_db** = ``-24.0``
  173. .. rst-class:: classref-property-setget
  174. - void **set_attenuation_filter_db** **(** :ref:`float<class_float>` value **)**
  175. - :ref:`float<class_float>` **get_attenuation_filter_db** **(** **)**
  176. Amount how much the filter affects the loudness, in decibels.
  177. .. rst-class:: classref-item-separator
  178. ----
  179. .. _class_AudioStreamPlayer3D_property_attenuation_model:
  180. .. rst-class:: classref-property
  181. :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **attenuation_model** = ``0``
  182. .. rst-class:: classref-property-setget
  183. - void **set_attenuation_model** **(** :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` value **)**
  184. - :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **get_attenuation_model** **(** **)**
  185. Decides if audio should get quieter with distance linearly, quadratically, logarithmically, or not be affected by distance, effectively disabling attenuation.
  186. .. rst-class:: classref-item-separator
  187. ----
  188. .. _class_AudioStreamPlayer3D_property_autoplay:
  189. .. rst-class:: classref-property
  190. :ref:`bool<class_bool>` **autoplay** = ``false``
  191. .. rst-class:: classref-property-setget
  192. - void **set_autoplay** **(** :ref:`bool<class_bool>` value **)**
  193. - :ref:`bool<class_bool>` **is_autoplay_enabled** **(** **)**
  194. If ``true``, audio plays when the AudioStreamPlayer3D node is added to scene tree.
  195. .. rst-class:: classref-item-separator
  196. ----
  197. .. _class_AudioStreamPlayer3D_property_bus:
  198. .. rst-class:: classref-property
  199. :ref:`String<class_String>` **bus** = ``"Master"``
  200. .. rst-class:: classref-property-setget
  201. - void **set_bus** **(** :ref:`String<class_String>` value **)**
  202. - :ref:`String<class_String>` **get_bus** **(** **)**
  203. The bus on which this audio is playing.
  204. \ **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"``.
  205. .. rst-class:: classref-item-separator
  206. ----
  207. .. _class_AudioStreamPlayer3D_property_doppler_tracking:
  208. .. rst-class:: classref-property
  209. :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **doppler_tracking** = ``0``
  210. .. rst-class:: classref-property-setget
  211. - void **set_doppler_tracking** **(** :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` value **)**
  212. - :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **get_doppler_tracking** **(** **)**
  213. Decides in which step the `Doppler effect <https://en.wikipedia.org/wiki/Doppler_effect>`__ should be calculated.
  214. \ **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>`.
  215. .. rst-class:: classref-item-separator
  216. ----
  217. .. _class_AudioStreamPlayer3D_property_emission_angle_degrees:
  218. .. rst-class:: classref-property
  219. :ref:`float<class_float>` **emission_angle_degrees** = ``45.0``
  220. .. rst-class:: classref-property-setget
  221. - void **set_emission_angle** **(** :ref:`float<class_float>` value **)**
  222. - :ref:`float<class_float>` **get_emission_angle** **(** **)**
  223. The angle in which the audio reaches cameras undampened.
  224. .. rst-class:: classref-item-separator
  225. ----
  226. .. _class_AudioStreamPlayer3D_property_emission_angle_enabled:
  227. .. rst-class:: classref-property
  228. :ref:`bool<class_bool>` **emission_angle_enabled** = ``false``
  229. .. rst-class:: classref-property-setget
  230. - void **set_emission_angle_enabled** **(** :ref:`bool<class_bool>` value **)**
  231. - :ref:`bool<class_bool>` **is_emission_angle_enabled** **(** **)**
  232. If ``true``, the audio should be dampened according to the direction of the sound.
  233. .. rst-class:: classref-item-separator
  234. ----
  235. .. _class_AudioStreamPlayer3D_property_emission_angle_filter_attenuation_db:
  236. .. rst-class:: classref-property
  237. :ref:`float<class_float>` **emission_angle_filter_attenuation_db** = ``-12.0``
  238. .. rst-class:: classref-property-setget
  239. - void **set_emission_angle_filter_attenuation_db** **(** :ref:`float<class_float>` value **)**
  240. - :ref:`float<class_float>` **get_emission_angle_filter_attenuation_db** **(** **)**
  241. 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.
  242. .. rst-class:: classref-item-separator
  243. ----
  244. .. _class_AudioStreamPlayer3D_property_max_db:
  245. .. rst-class:: classref-property
  246. :ref:`float<class_float>` **max_db** = ``3.0``
  247. .. rst-class:: classref-property-setget
  248. - void **set_max_db** **(** :ref:`float<class_float>` value **)**
  249. - :ref:`float<class_float>` **get_max_db** **(** **)**
  250. Sets the absolute maximum of the soundlevel, in decibels.
  251. .. rst-class:: classref-item-separator
  252. ----
  253. .. _class_AudioStreamPlayer3D_property_max_distance:
  254. .. rst-class:: classref-property
  255. :ref:`float<class_float>` **max_distance** = ``0.0``
  256. .. rst-class:: classref-property-setget
  257. - void **set_max_distance** **(** :ref:`float<class_float>` value **)**
  258. - :ref:`float<class_float>` **get_max_distance** **(** **)**
  259. 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.
  260. .. rst-class:: classref-item-separator
  261. ----
  262. .. _class_AudioStreamPlayer3D_property_out_of_range_mode:
  263. .. rst-class:: classref-property
  264. :ref:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` **out_of_range_mode** = ``0``
  265. .. rst-class:: classref-property-setget
  266. - void **set_out_of_range_mode** **(** :ref:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` value **)**
  267. - :ref:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` **get_out_of_range_mode** **(** **)**
  268. Decides if audio should pause when source is outside of :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` range.
  269. .. rst-class:: classref-item-separator
  270. ----
  271. .. _class_AudioStreamPlayer3D_property_panning_strength:
  272. .. rst-class:: classref-property
  273. :ref:`float<class_float>` **panning_strength** = ``1.0``
  274. .. rst-class:: classref-property-setget
  275. - void **set_panning_strength** **(** :ref:`float<class_float>` value **)**
  276. - :ref:`float<class_float>` **get_panning_strength** **(** **)**
  277. Scales the panning strength for this node by multiplying the base :ref:`ProjectSettings.audio/3d_panning_strength<class_ProjectSettings_property_audio/3d_panning_strength>` with this factor. Higher values will pan audio from left to right more dramatically than lower values.
  278. .. rst-class:: classref-item-separator
  279. ----
  280. .. _class_AudioStreamPlayer3D_property_pitch_scale:
  281. .. rst-class:: classref-property
  282. :ref:`float<class_float>` **pitch_scale** = ``1.0``
  283. .. rst-class:: classref-property-setget
  284. - void **set_pitch_scale** **(** :ref:`float<class_float>` value **)**
  285. - :ref:`float<class_float>` **get_pitch_scale** **(** **)**
  286. The pitch and the tempo of the audio, as a multiplier of the audio sample's sample rate.
  287. .. rst-class:: classref-item-separator
  288. ----
  289. .. _class_AudioStreamPlayer3D_property_playing:
  290. .. rst-class:: classref-property
  291. :ref:`bool<class_bool>` **playing** = ``false``
  292. .. rst-class:: classref-property-setget
  293. - :ref:`bool<class_bool>` **is_playing** **(** **)**
  294. If ``true``, audio is playing.
  295. .. rst-class:: classref-item-separator
  296. ----
  297. .. _class_AudioStreamPlayer3D_property_stream:
  298. .. rst-class:: classref-property
  299. :ref:`AudioStream<class_AudioStream>` **stream**
  300. .. rst-class:: classref-property-setget
  301. - void **set_stream** **(** :ref:`AudioStream<class_AudioStream>` value **)**
  302. - :ref:`AudioStream<class_AudioStream>` **get_stream** **(** **)**
  303. The :ref:`AudioStream<class_AudioStream>` resource to be played.
  304. .. rst-class:: classref-item-separator
  305. ----
  306. .. _class_AudioStreamPlayer3D_property_stream_paused:
  307. .. rst-class:: classref-property
  308. :ref:`bool<class_bool>` **stream_paused** = ``false``
  309. .. rst-class:: classref-property-setget
  310. - void **set_stream_paused** **(** :ref:`bool<class_bool>` value **)**
  311. - :ref:`bool<class_bool>` **get_stream_paused** **(** **)**
  312. If ``true``, the playback is paused. You can resume it by setting :ref:`stream_paused<class_AudioStreamPlayer3D_property_stream_paused>` to ``false``.
  313. .. rst-class:: classref-item-separator
  314. ----
  315. .. _class_AudioStreamPlayer3D_property_unit_db:
  316. .. rst-class:: classref-property
  317. :ref:`float<class_float>` **unit_db** = ``0.0``
  318. .. rst-class:: classref-property-setget
  319. - void **set_unit_db** **(** :ref:`float<class_float>` value **)**
  320. - :ref:`float<class_float>` **get_unit_db** **(** **)**
  321. The base sound level unaffected by dampening, in decibels.
  322. .. rst-class:: classref-item-separator
  323. ----
  324. .. _class_AudioStreamPlayer3D_property_unit_size:
  325. .. rst-class:: classref-property
  326. :ref:`float<class_float>` **unit_size** = ``1.0``
  327. .. rst-class:: classref-property-setget
  328. - void **set_unit_size** **(** :ref:`float<class_float>` value **)**
  329. - :ref:`float<class_float>` **get_unit_size** **(** **)**
  330. The factor for the attenuation effect. Higher values make the sound audible over a larger distance.
  331. .. rst-class:: classref-section-separator
  332. ----
  333. .. rst-class:: classref-descriptions-group
  334. Method Descriptions
  335. -------------------
  336. .. _class_AudioStreamPlayer3D_method_get_playback_position:
  337. .. rst-class:: classref-method
  338. :ref:`float<class_float>` **get_playback_position** **(** **)**
  339. Returns the position in the :ref:`AudioStream<class_AudioStream>`.
  340. .. rst-class:: classref-item-separator
  341. ----
  342. .. _class_AudioStreamPlayer3D_method_get_stream_playback:
  343. .. rst-class:: classref-method
  344. :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **get_stream_playback** **(** **)**
  345. Returns the :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` object associated with this **AudioStreamPlayer3D**.
  346. .. rst-class:: classref-item-separator
  347. ----
  348. .. _class_AudioStreamPlayer3D_method_play:
  349. .. rst-class:: classref-method
  350. void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
  351. Plays the audio from the given position ``from_position``, in seconds.
  352. .. rst-class:: classref-item-separator
  353. ----
  354. .. _class_AudioStreamPlayer3D_method_seek:
  355. .. rst-class:: classref-method
  356. void **seek** **(** :ref:`float<class_float>` to_position **)**
  357. Sets the position from which audio will be played, in seconds.
  358. .. rst-class:: classref-item-separator
  359. ----
  360. .. _class_AudioStreamPlayer3D_method_stop:
  361. .. rst-class:: classref-method
  362. void **stop** **(** **)**
  363. Stops the audio.
  364. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  365. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  366. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  367. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`