class_audiostreamplayer3d.rst 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  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. | void | :ref:`play<class_AudioStreamPlayer3D_method_play>` **(** :ref:`float<class_float>` from_position=0.0 **)** |
  59. +---------------------------+------------------------------------------------------------------------------------------------------------+
  60. | void | :ref:`seek<class_AudioStreamPlayer3D_method_seek>` **(** :ref:`float<class_float>` to_position **)** |
  61. +---------------------------+------------------------------------------------------------------------------------------------------------+
  62. | void | :ref:`stop<class_AudioStreamPlayer3D_method_stop>` **(** **)** |
  63. +---------------------------+------------------------------------------------------------------------------------------------------------+
  64. Signals
  65. -------
  66. .. _class_AudioStreamPlayer3D_signal_finished:
  67. - **finished** **(** **)**
  68. Fires when the audio stops playing.
  69. Enumerations
  70. ------------
  71. .. _enum_AudioStreamPlayer3D_AttenuationModel:
  72. .. _class_AudioStreamPlayer3D_constant_ATTENUATION_INVERSE_DISTANCE:
  73. .. _class_AudioStreamPlayer3D_constant_ATTENUATION_INVERSE_SQUARE_DISTANCE:
  74. .. _class_AudioStreamPlayer3D_constant_ATTENUATION_LOGARITHMIC:
  75. enum **AttenuationModel**:
  76. - **ATTENUATION_INVERSE_DISTANCE** = **0** --- Linear dampening of loudness according to distance.
  77. - **ATTENUATION_INVERSE_SQUARE_DISTANCE** = **1** --- Squared dampening of loudness according to distance.
  78. - **ATTENUATION_LOGARITHMIC** = **2** --- Logarithmic dampening of loudness according to distance.
  79. .. _enum_AudioStreamPlayer3D_OutOfRangeMode:
  80. .. _class_AudioStreamPlayer3D_constant_OUT_OF_RANGE_MIX:
  81. .. _class_AudioStreamPlayer3D_constant_OUT_OF_RANGE_PAUSE:
  82. enum **OutOfRangeMode**:
  83. - **OUT_OF_RANGE_MIX** = **0** --- Mix this audio in, even when it's out of range.
  84. - **OUT_OF_RANGE_PAUSE** = **1** --- Pause this audio when it gets out of range.
  85. .. _enum_AudioStreamPlayer3D_DopplerTracking:
  86. .. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_DISABLED:
  87. .. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_IDLE_STEP:
  88. .. _class_AudioStreamPlayer3D_constant_DOPPLER_TRACKING_PHYSICS_STEP:
  89. enum **DopplerTracking**:
  90. - **DOPPLER_TRACKING_DISABLED** = **0** --- Disables doppler tracking.
  91. - **DOPPLER_TRACKING_IDLE_STEP** = **1** --- Executes doppler tracking in idle step.
  92. - **DOPPLER_TRACKING_PHYSICS_STEP** = **2** --- Executes doppler tracking in physics step.
  93. Description
  94. -----------
  95. Plays a sound effect with directed sound effects, dampens with distance if needed, generates effect of hearable position in space.
  96. Tutorials
  97. ---------
  98. - :doc:`../tutorials/audio/audio_streams`
  99. Property Descriptions
  100. ---------------------
  101. .. _class_AudioStreamPlayer3D_property_area_mask:
  102. - :ref:`int<class_int>` **area_mask**
  103. +----------+----------------------+
  104. | *Setter* | set_area_mask(value) |
  105. +----------+----------------------+
  106. | *Getter* | get_area_mask() |
  107. +----------+----------------------+
  108. Areas in which this sound plays.
  109. .. _class_AudioStreamPlayer3D_property_attenuation_filter_cutoff_hz:
  110. - :ref:`float<class_float>` **attenuation_filter_cutoff_hz**
  111. +----------+-----------------------------------------+
  112. | *Setter* | set_attenuation_filter_cutoff_hz(value) |
  113. +----------+-----------------------------------------+
  114. | *Getter* | get_attenuation_filter_cutoff_hz() |
  115. +----------+-----------------------------------------+
  116. Dampens audio above this frequency, in Hz.
  117. .. _class_AudioStreamPlayer3D_property_attenuation_filter_db:
  118. - :ref:`float<class_float>` **attenuation_filter_db**
  119. +----------+----------------------------------+
  120. | *Setter* | set_attenuation_filter_db(value) |
  121. +----------+----------------------------------+
  122. | *Getter* | get_attenuation_filter_db() |
  123. +----------+----------------------------------+
  124. Amount how much the filter affects the loudness, in dB.
  125. .. _class_AudioStreamPlayer3D_property_attenuation_model:
  126. - :ref:`AttenuationModel<enum_AudioStreamPlayer3D_AttenuationModel>` **attenuation_model**
  127. +----------+------------------------------+
  128. | *Setter* | set_attenuation_model(value) |
  129. +----------+------------------------------+
  130. | *Getter* | get_attenuation_model() |
  131. +----------+------------------------------+
  132. Decides if audio should get quieter with distance linearly, quadratically or logarithmically.
  133. .. _class_AudioStreamPlayer3D_property_autoplay:
  134. - :ref:`bool<class_bool>` **autoplay**
  135. +----------+-----------------------+
  136. | *Setter* | set_autoplay(value) |
  137. +----------+-----------------------+
  138. | *Getter* | is_autoplay_enabled() |
  139. +----------+-----------------------+
  140. If ``true``, audio plays when added to scene tree. Default value: ``false``.
  141. .. _class_AudioStreamPlayer3D_property_bus:
  142. - :ref:`String<class_String>` **bus**
  143. +----------+----------------+
  144. | *Setter* | set_bus(value) |
  145. +----------+----------------+
  146. | *Getter* | get_bus() |
  147. +----------+----------------+
  148. Bus on which this audio is playing.
  149. .. _class_AudioStreamPlayer3D_property_doppler_tracking:
  150. - :ref:`DopplerTracking<enum_AudioStreamPlayer3D_DopplerTracking>` **doppler_tracking**
  151. +----------+-----------------------------+
  152. | *Setter* | set_doppler_tracking(value) |
  153. +----------+-----------------------------+
  154. | *Getter* | get_doppler_tracking() |
  155. +----------+-----------------------------+
  156. Decides in which step the Doppler effect should be calculated.
  157. .. _class_AudioStreamPlayer3D_property_emission_angle_degrees:
  158. - :ref:`float<class_float>` **emission_angle_degrees**
  159. +----------+---------------------------+
  160. | *Setter* | set_emission_angle(value) |
  161. +----------+---------------------------+
  162. | *Getter* | get_emission_angle() |
  163. +----------+---------------------------+
  164. The angle in which the audio reaches cameras undampened.
  165. .. _class_AudioStreamPlayer3D_property_emission_angle_enabled:
  166. - :ref:`bool<class_bool>` **emission_angle_enabled**
  167. +----------+-----------------------------------+
  168. | *Setter* | set_emission_angle_enabled(value) |
  169. +----------+-----------------------------------+
  170. | *Getter* | is_emission_angle_enabled() |
  171. +----------+-----------------------------------+
  172. If ``true``, the audio should be dampened according to the direction of the sound.
  173. .. _class_AudioStreamPlayer3D_property_emission_angle_filter_attenuation_db:
  174. - :ref:`float<class_float>` **emission_angle_filter_attenuation_db**
  175. +----------+-------------------------------------------------+
  176. | *Setter* | set_emission_angle_filter_attenuation_db(value) |
  177. +----------+-------------------------------------------------+
  178. | *Getter* | get_emission_angle_filter_attenuation_db() |
  179. +----------+-------------------------------------------------+
  180. dampens audio if camera is outside of 'emission_angle_degrees' and 'emission_angle_enabled' is set by this factor, in dB.
  181. .. _class_AudioStreamPlayer3D_property_max_db:
  182. - :ref:`float<class_float>` **max_db**
  183. +----------+-------------------+
  184. | *Setter* | set_max_db(value) |
  185. +----------+-------------------+
  186. | *Getter* | get_max_db() |
  187. +----------+-------------------+
  188. Sets the absolute maximum of the soundlevel, in dB.
  189. .. _class_AudioStreamPlayer3D_property_max_distance:
  190. - :ref:`float<class_float>` **max_distance**
  191. +----------+-------------------------+
  192. | *Setter* | set_max_distance(value) |
  193. +----------+-------------------------+
  194. | *Getter* | get_max_distance() |
  195. +----------+-------------------------+
  196. Sets the distance from which the 'out_of_range_mode' takes effect. Has no effect if set to 0.
  197. .. _class_AudioStreamPlayer3D_property_out_of_range_mode:
  198. - :ref:`OutOfRangeMode<enum_AudioStreamPlayer3D_OutOfRangeMode>` **out_of_range_mode**
  199. +----------+------------------------------+
  200. | *Setter* | set_out_of_range_mode(value) |
  201. +----------+------------------------------+
  202. | *Getter* | get_out_of_range_mode() |
  203. +----------+------------------------------+
  204. Decides if audio should pause when source is outside of 'max_distance' range.
  205. .. _class_AudioStreamPlayer3D_property_pitch_scale:
  206. - :ref:`float<class_float>` **pitch_scale**
  207. +----------+------------------------+
  208. | *Setter* | set_pitch_scale(value) |
  209. +----------+------------------------+
  210. | *Getter* | get_pitch_scale() |
  211. +----------+------------------------+
  212. Changes the pitch and the tempo of the audio.
  213. .. _class_AudioStreamPlayer3D_property_playing:
  214. - :ref:`bool<class_bool>` **playing**
  215. +----------+--------------+
  216. | *Getter* | is_playing() |
  217. +----------+--------------+
  218. If ``true``, audio is playing.
  219. .. _class_AudioStreamPlayer3D_property_stream:
  220. - :ref:`AudioStream<class_AudioStream>` **stream**
  221. +----------+-------------------+
  222. | *Setter* | set_stream(value) |
  223. +----------+-------------------+
  224. | *Getter* | get_stream() |
  225. +----------+-------------------+
  226. The :ref:`AudioStream<class_AudioStream>` object to be played.
  227. .. _class_AudioStreamPlayer3D_property_stream_paused:
  228. - :ref:`bool<class_bool>` **stream_paused**
  229. +----------+--------------------------+
  230. | *Setter* | set_stream_paused(value) |
  231. +----------+--------------------------+
  232. | *Getter* | get_stream_paused() |
  233. +----------+--------------------------+
  234. .. _class_AudioStreamPlayer3D_property_unit_db:
  235. - :ref:`float<class_float>` **unit_db**
  236. +----------+--------------------+
  237. | *Setter* | set_unit_db(value) |
  238. +----------+--------------------+
  239. | *Getter* | get_unit_db() |
  240. +----------+--------------------+
  241. Base sound level unaffected by dampening, in dB.
  242. .. _class_AudioStreamPlayer3D_property_unit_size:
  243. - :ref:`float<class_float>` **unit_size**
  244. +----------+----------------------+
  245. | *Setter* | set_unit_size(value) |
  246. +----------+----------------------+
  247. | *Getter* | get_unit_size() |
  248. +----------+----------------------+
  249. Factor for the attenuation effect.
  250. Method Descriptions
  251. -------------------
  252. .. _class_AudioStreamPlayer3D_method_get_playback_position:
  253. - :ref:`float<class_float>` **get_playback_position** **(** **)**
  254. Returns the position in the :ref:`AudioStream<class_AudioStream>`.
  255. .. _class_AudioStreamPlayer3D_method_play:
  256. - void **play** **(** :ref:`float<class_float>` from_position=0.0 **)**
  257. Plays the audio from the given position 'from_position', in seconds.
  258. .. _class_AudioStreamPlayer3D_method_seek:
  259. - void **seek** **(** :ref:`float<class_float>` to_position **)**
  260. Sets the position from which audio will be played, in seconds.
  261. .. _class_AudioStreamPlayer3D_method_stop:
  262. - void **stop** **(** **)**
  263. Stops the audio.