class_audioeffectcompressor.rst 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/AudioEffectCompressor.xml.
  6. .. _class_AudioEffectCompressor:
  7. AudioEffectCompressor
  8. =====================
  9. **Inherits:** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. Adds a compressor audio effect to an audio bus.
  11. Reduces sounds that exceed a certain threshold level, smooths out the dynamics and increases the overall volume.
  12. .. rst-class:: classref-introduction-group
  13. Description
  14. -----------
  15. Dynamic range compressor reduces the level of the sound when the amplitude goes over a certain threshold in Decibels. One of the main uses of a compressor is to increase the dynamic range by clipping as little as possible (when sound goes over 0dB).
  16. Compressor has many uses in the mix:
  17. - In the Master bus to compress the whole output (although an :ref:`AudioEffectLimiter<class_AudioEffectLimiter>` is probably better).
  18. - In voice channels to ensure they sound as balanced as possible.
  19. - Sidechained. This can reduce the sound level sidechained with another audio bus for threshold detection. This technique is common in video game mixing to the level of music and SFX while voices are being heard.
  20. - Accentuates transients by using a wider attack, making effects sound more punchy.
  21. .. rst-class:: classref-introduction-group
  22. Tutorials
  23. ---------
  24. - :doc:`Audio buses <../tutorials/audio/audio_buses>`
  25. .. rst-class:: classref-reftable-group
  26. Properties
  27. ----------
  28. .. table::
  29. :widths: auto
  30. +-------------------------------------+--------------------------------------------------------------------+-----------+
  31. | :ref:`float<class_float>` | :ref:`attack_us<class_AudioEffectCompressor_property_attack_us>` | ``20.0`` |
  32. +-------------------------------------+--------------------------------------------------------------------+-----------+
  33. | :ref:`float<class_float>` | :ref:`gain<class_AudioEffectCompressor_property_gain>` | ``0.0`` |
  34. +-------------------------------------+--------------------------------------------------------------------+-----------+
  35. | :ref:`float<class_float>` | :ref:`mix<class_AudioEffectCompressor_property_mix>` | ``1.0`` |
  36. +-------------------------------------+--------------------------------------------------------------------+-----------+
  37. | :ref:`float<class_float>` | :ref:`ratio<class_AudioEffectCompressor_property_ratio>` | ``4.0`` |
  38. +-------------------------------------+--------------------------------------------------------------------+-----------+
  39. | :ref:`float<class_float>` | :ref:`release_ms<class_AudioEffectCompressor_property_release_ms>` | ``250.0`` |
  40. +-------------------------------------+--------------------------------------------------------------------+-----------+
  41. | :ref:`StringName<class_StringName>` | :ref:`sidechain<class_AudioEffectCompressor_property_sidechain>` | ``&""`` |
  42. +-------------------------------------+--------------------------------------------------------------------+-----------+
  43. | :ref:`float<class_float>` | :ref:`threshold<class_AudioEffectCompressor_property_threshold>` | ``0.0`` |
  44. +-------------------------------------+--------------------------------------------------------------------+-----------+
  45. .. rst-class:: classref-section-separator
  46. ----
  47. .. rst-class:: classref-descriptions-group
  48. Property Descriptions
  49. ---------------------
  50. .. _class_AudioEffectCompressor_property_attack_us:
  51. .. rst-class:: classref-property
  52. :ref:`float<class_float>` **attack_us** = ``20.0`` :ref:`🔗<class_AudioEffectCompressor_property_attack_us>`
  53. .. rst-class:: classref-property-setget
  54. - |void| **set_attack_us**\ (\ value\: :ref:`float<class_float>`\ )
  55. - :ref:`float<class_float>` **get_attack_us**\ (\ )
  56. Compressor's reaction time when the signal exceeds the threshold, in microseconds. Value can range from 20 to 2000.
  57. .. rst-class:: classref-item-separator
  58. ----
  59. .. _class_AudioEffectCompressor_property_gain:
  60. .. rst-class:: classref-property
  61. :ref:`float<class_float>` **gain** = ``0.0`` :ref:`🔗<class_AudioEffectCompressor_property_gain>`
  62. .. rst-class:: classref-property-setget
  63. - |void| **set_gain**\ (\ value\: :ref:`float<class_float>`\ )
  64. - :ref:`float<class_float>` **get_gain**\ (\ )
  65. Gain applied to the output signal.
  66. .. rst-class:: classref-item-separator
  67. ----
  68. .. _class_AudioEffectCompressor_property_mix:
  69. .. rst-class:: classref-property
  70. :ref:`float<class_float>` **mix** = ``1.0`` :ref:`🔗<class_AudioEffectCompressor_property_mix>`
  71. .. rst-class:: classref-property-setget
  72. - |void| **set_mix**\ (\ value\: :ref:`float<class_float>`\ )
  73. - :ref:`float<class_float>` **get_mix**\ (\ )
  74. Balance between original signal and effect signal. Value can range from 0 (totally dry) to 1 (totally wet).
  75. .. rst-class:: classref-item-separator
  76. ----
  77. .. _class_AudioEffectCompressor_property_ratio:
  78. .. rst-class:: classref-property
  79. :ref:`float<class_float>` **ratio** = ``4.0`` :ref:`🔗<class_AudioEffectCompressor_property_ratio>`
  80. .. rst-class:: classref-property-setget
  81. - |void| **set_ratio**\ (\ value\: :ref:`float<class_float>`\ )
  82. - :ref:`float<class_float>` **get_ratio**\ (\ )
  83. Amount of compression applied to the audio once it passes the threshold level. The higher the ratio, the more the loud parts of the audio will be compressed. Value can range from 1 to 48.
  84. .. rst-class:: classref-item-separator
  85. ----
  86. .. _class_AudioEffectCompressor_property_release_ms:
  87. .. rst-class:: classref-property
  88. :ref:`float<class_float>` **release_ms** = ``250.0`` :ref:`🔗<class_AudioEffectCompressor_property_release_ms>`
  89. .. rst-class:: classref-property-setget
  90. - |void| **set_release_ms**\ (\ value\: :ref:`float<class_float>`\ )
  91. - :ref:`float<class_float>` **get_release_ms**\ (\ )
  92. Compressor's delay time to stop reducing the signal after the signal level falls below the threshold, in milliseconds. Value can range from 20 to 2000.
  93. .. rst-class:: classref-item-separator
  94. ----
  95. .. _class_AudioEffectCompressor_property_sidechain:
  96. .. rst-class:: classref-property
  97. :ref:`StringName<class_StringName>` **sidechain** = ``&""`` :ref:`🔗<class_AudioEffectCompressor_property_sidechain>`
  98. .. rst-class:: classref-property-setget
  99. - |void| **set_sidechain**\ (\ value\: :ref:`StringName<class_StringName>`\ )
  100. - :ref:`StringName<class_StringName>` **get_sidechain**\ (\ )
  101. Reduce the sound level using another audio bus for threshold detection.
  102. .. rst-class:: classref-item-separator
  103. ----
  104. .. _class_AudioEffectCompressor_property_threshold:
  105. .. rst-class:: classref-property
  106. :ref:`float<class_float>` **threshold** = ``0.0`` :ref:`🔗<class_AudioEffectCompressor_property_threshold>`
  107. .. rst-class:: classref-property-setget
  108. - |void| **set_threshold**\ (\ value\: :ref:`float<class_float>`\ )
  109. - :ref:`float<class_float>` **get_threshold**\ (\ )
  110. The level above which compression is applied to the audio. Value can range from -60 to 0.
  111. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  112. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  113. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  114. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  115. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  116. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  117. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`
  118. .. |void| replace:: :abbr:`void (No return value.)`