class_audiostreamplayer3d.rst 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the AudioStreamPlayer3D.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_AudioStreamPlayer3D:
  5. AudioStreamPlayer3D
  6. ===================
  7. **Inherits:** :ref:`Spatial<class_Spatial>` **<** :ref:`Node<class_Node>` **<** :ref:`Object<class_Object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Plays 3D sound in 3D space.
  12. Properties
  13. ----------
  14. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
  15. | :ref:`int<class_int>` | :ref:`area_mask<class_AudioStreamPlayer3D_property_area_mask>` |
  16. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
  17. | :ref:`float<class_float>` | :ref:`attenuation_filter_cutoff_hz<class_AudioStreamPlayer3D_property_attenuation_filter_cutoff_hz>` |
  18. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
  19. | :ref:`float<class_float>` | :ref:`attenuation_filter_db<class_AudioStreamPlayer3D_property_attenuation_filter_db>` |
  20. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
  21. | :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` | :ref:`attenuation_model<class_AudioStreamPlayer3D_property_attenuation_model>` |
  22. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
  23. | :ref:`bool<class_bool>` | :ref:`autoplay<class_AudioStreamPlayer3D_property_autoplay>` |
  24. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
  25. | :ref:`String<class_String>` | :ref:`bus<class_AudioStreamPlayer3D_property_bus>` |
  26. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
  27. | :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` | :ref:`doppler_tracking<class_AudioStreamPlayer3D_property_doppler_tracking>` |
  28. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
  29. | :ref:`float<class_float>` | :ref:`emission_angle_degrees<class_AudioStreamPlayer3D_property_emission_angle_degrees>` |
  30. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
  31. | :ref:`bool<class_bool>` | :ref:`emission_angle_enabled<class_AudioStreamPlayer3D_property_emission_angle_enabled>` |
  32. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
  33. | :ref:`float<class_float>` | :ref:`emission_angle_filter_attenuation_db<class_AudioStreamPlayer3D_property_emission_angle_filter_attenuation_db>` |
  34. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
  35. | :ref:`float<class_float>` | :ref:`max_db<class_AudioStreamPlayer3D_property_max_db>` |
  36. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
  37. | :ref:`float<class_float>` | :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` |
  38. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
  39. | :ref:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` | :ref:`out_of_range_mode<class_AudioStreamPlayer3D_property_out_of_range_mode>` |
  40. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
  41. | :ref:`float<class_float>` | :ref:`pitch_scale<class_AudioStreamPlayer3D_property_pitch_scale>` |
  42. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
  43. | :ref:`bool<class_bool>` | :ref:`playing<class_AudioStreamPlayer3D_property_playing>` |
  44. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
  45. | :ref:`AudioStream<class_AudioStream>` | :ref:`stream<class_AudioStreamPlayer3D_property_stream>` |
  46. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
  47. | :ref:`bool<class_bool>` | :ref:`stream_paused<class_AudioStreamPlayer3D_property_stream_paused>` |
  48. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
  49. | :ref:`float<class_float>` | :ref:`unit_db<class_AudioStreamPlayer3D_property_unit_db>` |
  50. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
  51. | :ref:`float<class_float>` | :ref:`unit_size<class_AudioStreamPlayer3D_property_unit_size>` |
  52. +--------------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------+
  53. Methods
  54. -------
  55. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  56. | :ref:`float<class_float>` | :ref:`get_playback_position<class_AudioStreamPlayer3D_method_get_playback_position>` **(** **)** |
  57. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  58. | :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` | :ref:`get_stream_playback<class_AudioStreamPlayer3D_method_get_stream_playback>` **(** **)** |
  59. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  60. | void | :ref:`play<class_AudioStreamPlayer3D_method_play>` **(** :ref:`float<class_float>` from_position=0.0 **)** |
  61. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  62. | void | :ref:`seek<class_AudioStreamPlayer3D_method_seek>` **(** :ref:`float<class_float>` to_position **)** |
  63. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  64. | void | :ref:`stop<class_AudioStreamPlayer3D_method_stop>` **(** **)** |
  65. +-------------------------------------------------------+------------------------------------------------------------------------------------------------------------+
  66. Signals
  67. -------
  68. .. _class_AudioStreamPlayer3D_signal_finished:
  69. - **finished** **(** **)**
  70. Emitted when the audio stops playing.
  71. Enumerations
  72. ------------
  73. .. _enum_AudioStreamPlayer3D_AttenuationModel:
  74. .. _class_AudioStreamPlayer3D_constant_ATTENUATION_INVERSE_DISTANCE:
  75. .. _class_AudioStreamPlayer3D_constant_ATTENUATION_INVERSE_SQUARE_DISTANCE:
  76. .. _class_AudioStreamPlayer3D_constant_ATTENUATION_LOGARITHMIC:
  77. .. _class_AudioStreamPlayer3D_constant_ATTENUATION_DISABLED:
  78. enum **AttenuationModel**:
  79. - **ATTENUATION_INVERSE_DISTANCE** = **0** --- Linear dampening of loudness according to distance.
  80. - **ATTENUATION_INVERSE_SQUARE_DISTANCE** = **1** --- Squared dampening of loudness according to distance.
  81. - **ATTENUATION_LOGARITHMIC** = **2** --- Logarithmic dampening of loudness according to distance.
  82. - **ATTENUATION_DISABLED** = **3** --- No dampening of loudness according to distance.
  83. .. _enum_AudioStreamPlayer3D_OutOfRangeMode:
  84. .. _class_AudioStreamPlayer3D_constant_OUT_OF_RANGE_MIX:
  85. .. _class_AudioStreamPlayer3D_constant_OUT_OF_RANGE_PAUSE:
  86. enum **OutOfRangeMode**:
  87. - **OUT_OF_RANGE_MIX** = **0** --- Mix this audio in, even when it's out of range.
  88. - **OUT_OF_RANGE_PAUSE** = **1** --- Pause this audio when it gets out of range.
  89. .. _enum_AudioStreamPlayer3D_DopplerTracking:
  90. .. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_DISABLED:
  91. .. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_IDLE_STEP:
  92. .. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_PHYSICS_STEP:
  93. enum **DopplerTracking**:
  94. - **DOPPLER_TRACKING_DISABLED** = **0** --- Disables doppler tracking.
  95. - **DOPPLER_TRACKING_IDLE_STEP** = **1** --- Executes doppler tracking in idle step.
  96. - **DOPPLER_TRACKING_PHYSICS_STEP** = **2** --- Executes doppler tracking in physics step.
  97. Description
  98. -----------
  99. Plays a sound effect with directed sound effects, dampens with distance if needed, generates effect of hearable position in space.
  100. Tutorials
  101. ---------
  102. - :doc:`../tutorials/audio/audio_streams`
  103. Property Descriptions
  104. ---------------------
  105. .. _class_AudioStreamPlayer3D_property_area_mask:
  106. - :ref:`int<class_int>` **area_mask**
  107. +----------+----------------------+
  108. | *Setter* | set_area_mask(value) |
  109. +----------+----------------------+
  110. | *Getter* | get_area_mask() |
  111. +----------+----------------------+
  112. Areas in which this sound plays.
  113. .. _class_AudioStreamPlayer3D_property_attenuation_filter_cutoff_hz:
  114. - :ref:`float<class_float>` **attenuation_filter_cutoff_hz**
  115. +----------+-----------------------------------------+
  116. | *Setter* | set_attenuation_filter_cutoff_hz(value) |
  117. +----------+-----------------------------------------+
  118. | *Getter* | get_attenuation_filter_cutoff_hz() |
  119. +----------+-----------------------------------------+
  120. Dampens audio above this frequency, in Hz.
  121. .. _class_AudioStreamPlayer3D_property_attenuation_filter_db:
  122. - :ref:`float<class_float>` **attenuation_filter_db**
  123. +----------+----------------------------------+
  124. | *Setter* | set_attenuation_filter_db(value) |
  125. +----------+----------------------------------+
  126. | *Getter* | get_attenuation_filter_db() |
  127. +----------+----------------------------------+
  128. Amount how much the filter affects the loudness, in dB.
  129. .. _class_AudioStreamPlayer3D_property_attenuation_model:
  130. - :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **attenuation_model**
  131. +----------+------------------------------+
  132. | *Setter* | set_attenuation_model(value) |
  133. +----------+------------------------------+
  134. | *Getter* | get_attenuation_model() |
  135. +----------+------------------------------+
  136. Decides if audio should get quieter with distance linearly, quadratically, logarithmically, or not be affected by distance, effectively disabling attenuation.
  137. .. _class_AudioStreamPlayer3D_property_autoplay:
  138. - :ref:`bool<class_bool>` **autoplay**
  139. +----------+-----------------------+
  140. | *Setter* | set_autoplay(value) |
  141. +----------+-----------------------+
  142. | *Getter* | is_autoplay_enabled() |
  143. +----------+-----------------------+
  144. If ``true``, audio plays when added to scene tree. Default value: ``false``.
  145. .. _class_AudioStreamPlayer3D_property_bus:
  146. - :ref:`String<class_String>` **bus**
  147. +----------+----------------+
  148. | *Setter* | set_bus(value) |
  149. +----------+----------------+
  150. | *Getter* | get_bus() |
  151. +----------+----------------+
  152. Bus on which this audio is playing.
  153. .. _class_AudioStreamPlayer3D_property_doppler_tracking:
  154. - :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **doppler_tracking**
  155. +----------+-----------------------------+
  156. | *Setter* | set_doppler_tracking(value) |
  157. +----------+-----------------------------+
  158. | *Getter* | get_doppler_tracking() |
  159. +----------+-----------------------------+
  160. Decides in which step the Doppler effect should be calculated.
  161. .. _class_AudioStreamPlayer3D_property_emission_angle_degrees:
  162. - :ref:`float<class_float>` **emission_angle_degrees**
  163. +----------+---------------------------+
  164. | *Setter* | set_emission_angle(value) |
  165. +----------+---------------------------+
  166. | *Getter* | get_emission_angle() |
  167. +----------+---------------------------+
  168. The angle in which the audio reaches cameras undampened.
  169. .. _class_AudioStreamPlayer3D_property_emission_angle_enabled:
  170. - :ref:`bool<class_bool>` **emission_angle_enabled**
  171. +----------+-----------------------------------+
  172. | *Setter* | set_emission_angle_enabled(value) |
  173. +----------+-----------------------------------+
  174. | *Getter* | is_emission_angle_enabled() |
  175. +----------+-----------------------------------+
  176. If ``true``, the audio should be dampened according to the direction of the sound.
  177. .. _class_AudioStreamPlayer3D_property_emission_angle_filter_attenuation_db:
  178. - :ref:`float<class_float>` **emission_angle_filter_attenuation_db**
  179. +----------+-------------------------------------------------+
  180. | *Setter* | set_emission_angle_filter_attenuation_db(value) |
  181. +----------+-------------------------------------------------+
  182. | *Getter* | get_emission_angle_filter_attenuation_db() |
  183. +----------+-------------------------------------------------+
  184. 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 dB.
  185. .. _class_AudioStreamPlayer3D_property_max_db:
  186. - :ref:`float<class_float>` **max_db**
  187. +----------+-------------------+
  188. | *Setter* | set_max_db(value) |
  189. +----------+-------------------+
  190. | *Getter* | get_max_db() |
  191. +----------+-------------------+
  192. Sets the absolute maximum of the soundlevel, in dB.
  193. .. _class_AudioStreamPlayer3D_property_max_distance:
  194. - :ref:`float<class_float>` **max_distance**
  195. +----------+-------------------------+
  196. | *Setter* | set_max_distance(value) |
  197. +----------+-------------------------+
  198. | *Getter* | get_max_distance() |
  199. +----------+-------------------------+
  200. 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.
  201. .. _class_AudioStreamPlayer3D_property_out_of_range_mode:
  202. - :ref:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` **out_of_range_mode**
  203. +----------+------------------------------+
  204. | *Setter* | set_out_of_range_mode(value) |
  205. +----------+------------------------------+
  206. | *Getter* | get_out_of_range_mode() |
  207. +----------+------------------------------+
  208. Decides if audio should pause when source is outside of :ref:`max_distance<class_AudioStreamPlayer3D_property_max_distance>` range.
  209. .. _class_AudioStreamPlayer3D_property_pitch_scale:
  210. - :ref:`float<class_float>` **pitch_scale**
  211. +----------+------------------------+
  212. | *Setter* | set_pitch_scale(value) |
  213. +----------+------------------------+
  214. | *Getter* | get_pitch_scale() |
  215. +----------+------------------------+
  216. Changes the pitch and the tempo of the audio.
  217. .. _class_AudioStreamPlayer3D_property_playing:
  218. - :ref:`bool<class_bool>` **playing**
  219. +----------+--------------+
  220. | *Getter* | is_playing() |
  221. +----------+--------------+
  222. If ``true``, audio is playing.
  223. .. _class_AudioStreamPlayer3D_property_stream:
  224. - :ref:`AudioStream<class_AudioStream>` **stream**
  225. +----------+-------------------+
  226. | *Setter* | set_stream(value) |
  227. +----------+-------------------+
  228. | *Getter* | get_stream() |
  229. +----------+-------------------+
  230. The :ref:`AudioStream<class_AudioStream>` object to be played.
  231. .. _class_AudioStreamPlayer3D_property_stream_paused:
  232. - :ref:`bool<class_bool>` **stream_paused**
  233. +----------+--------------------------+
  234. | *Setter* | set_stream_paused(value) |
  235. +----------+--------------------------+
  236. | *Getter* | get_stream_paused() |
  237. +----------+--------------------------+
  238. .. _class_AudioStreamPlayer3D_property_unit_db:
  239. - :ref:`float<class_float>` **unit_db**
  240. +----------+--------------------+
  241. | *Setter* | set_unit_db(value) |
  242. +----------+--------------------+
  243. | *Getter* | get_unit_db() |
  244. +----------+--------------------+
  245. Base sound level unaffected by dampening, in dB.
  246. .. _class_AudioStreamPlayer3D_property_unit_size:
  247. - :ref:`float<class_float>` **unit_size**
  248. +----------+----------------------+
  249. | *Setter* | set_unit_size(value) |
  250. +----------+----------------------+
  251. | *Getter* | get_unit_size() |
  252. +----------+----------------------+
  253. Factor for the attenuation effect.
  254. Method Descriptions
  255. -------------------
  256. .. _class_AudioStreamPlayer3D_method_get_playback_position:
  257. - :ref:`float<class_float>` **get_playback_position** **(** **)**
  258. Returns the position in the :ref:`AudioStream<class_AudioStream>`.
  259. .. _class_AudioStreamPlayer3D_method_get_stream_playback:
  260. - :ref:`AudioStreamPlayback<class_AudioStreamPlayback>` **get_stream_playback** **(** **)**
  261. .. _class_AudioStreamPlayer3D_method_play:
  262. - void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
  263. Plays the audio from the given position ``from_position``, in seconds.
  264. .. _class_AudioStreamPlayer3D_method_seek:
  265. - void **seek** **(** :ref:`float<class_float>` to_position **)**
  266. Sets the position from which audio will be played, in seconds.
  267. .. _class_AudioStreamPlayer3D_method_stop:
  268. - void **stop** **(** **)**
  269. Stops the audio.