class_audioeffectcompressor.rst 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  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/AudioEffectCompressor.xml.
  6. .. _class_AudioEffectCompressor:
  7. AudioEffectCompressor
  8. =====================
  9. **Inherits:** :ref:`AudioEffect<class_AudioEffect>` **<** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :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-reftable-group
  22. Properties
  23. ----------
  24. .. table::
  25. :widths: auto
  26. +-----------------------------+--------------------------------------------------------------------+-----------+
  27. | :ref:`float<class_float>` | :ref:`attack_us<class_AudioEffectCompressor_property_attack_us>` | ``20.0`` |
  28. +-----------------------------+--------------------------------------------------------------------+-----------+
  29. | :ref:`float<class_float>` | :ref:`gain<class_AudioEffectCompressor_property_gain>` | ``0.0`` |
  30. +-----------------------------+--------------------------------------------------------------------+-----------+
  31. | :ref:`float<class_float>` | :ref:`mix<class_AudioEffectCompressor_property_mix>` | ``1.0`` |
  32. +-----------------------------+--------------------------------------------------------------------+-----------+
  33. | :ref:`float<class_float>` | :ref:`ratio<class_AudioEffectCompressor_property_ratio>` | ``4.0`` |
  34. +-----------------------------+--------------------------------------------------------------------+-----------+
  35. | :ref:`float<class_float>` | :ref:`release_ms<class_AudioEffectCompressor_property_release_ms>` | ``250.0`` |
  36. +-----------------------------+--------------------------------------------------------------------+-----------+
  37. | :ref:`String<class_String>` | :ref:`sidechain<class_AudioEffectCompressor_property_sidechain>` | ``""`` |
  38. +-----------------------------+--------------------------------------------------------------------+-----------+
  39. | :ref:`float<class_float>` | :ref:`threshold<class_AudioEffectCompressor_property_threshold>` | ``0.0`` |
  40. +-----------------------------+--------------------------------------------------------------------+-----------+
  41. .. rst-class:: classref-section-separator
  42. ----
  43. .. rst-class:: classref-descriptions-group
  44. Property Descriptions
  45. ---------------------
  46. .. _class_AudioEffectCompressor_property_attack_us:
  47. .. rst-class:: classref-property
  48. :ref:`float<class_float>` **attack_us** = ``20.0``
  49. .. rst-class:: classref-property-setget
  50. - void **set_attack_us** **(** :ref:`float<class_float>` value **)**
  51. - :ref:`float<class_float>` **get_attack_us** **(** **)**
  52. Compressor's reaction time when the signal exceeds the threshold, in microseconds. Value can range from 20 to 2000.
  53. .. rst-class:: classref-item-separator
  54. ----
  55. .. _class_AudioEffectCompressor_property_gain:
  56. .. rst-class:: classref-property
  57. :ref:`float<class_float>` **gain** = ``0.0``
  58. .. rst-class:: classref-property-setget
  59. - void **set_gain** **(** :ref:`float<class_float>` value **)**
  60. - :ref:`float<class_float>` **get_gain** **(** **)**
  61. Gain applied to the output signal.
  62. .. rst-class:: classref-item-separator
  63. ----
  64. .. _class_AudioEffectCompressor_property_mix:
  65. .. rst-class:: classref-property
  66. :ref:`float<class_float>` **mix** = ``1.0``
  67. .. rst-class:: classref-property-setget
  68. - void **set_mix** **(** :ref:`float<class_float>` value **)**
  69. - :ref:`float<class_float>` **get_mix** **(** **)**
  70. Balance between original signal and effect signal. Value can range from 0 (totally dry) to 1 (totally wet).
  71. .. rst-class:: classref-item-separator
  72. ----
  73. .. _class_AudioEffectCompressor_property_ratio:
  74. .. rst-class:: classref-property
  75. :ref:`float<class_float>` **ratio** = ``4.0``
  76. .. rst-class:: classref-property-setget
  77. - void **set_ratio** **(** :ref:`float<class_float>` value **)**
  78. - :ref:`float<class_float>` **get_ratio** **(** **)**
  79. 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.
  80. .. rst-class:: classref-item-separator
  81. ----
  82. .. _class_AudioEffectCompressor_property_release_ms:
  83. .. rst-class:: classref-property
  84. :ref:`float<class_float>` **release_ms** = ``250.0``
  85. .. rst-class:: classref-property-setget
  86. - void **set_release_ms** **(** :ref:`float<class_float>` value **)**
  87. - :ref:`float<class_float>` **get_release_ms** **(** **)**
  88. 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.
  89. .. rst-class:: classref-item-separator
  90. ----
  91. .. _class_AudioEffectCompressor_property_sidechain:
  92. .. rst-class:: classref-property
  93. :ref:`String<class_String>` **sidechain** = ``""``
  94. .. rst-class:: classref-property-setget
  95. - void **set_sidechain** **(** :ref:`String<class_String>` value **)**
  96. - :ref:`String<class_String>` **get_sidechain** **(** **)**
  97. Reduce the sound level using another audio bus for threshold detection.
  98. .. rst-class:: classref-item-separator
  99. ----
  100. .. _class_AudioEffectCompressor_property_threshold:
  101. .. rst-class:: classref-property
  102. :ref:`float<class_float>` **threshold** = ``0.0``
  103. .. rst-class:: classref-property-setget
  104. - void **set_threshold** **(** :ref:`float<class_float>` value **)**
  105. - :ref:`float<class_float>` **get_threshold** **(** **)**
  106. The level above which compression is applied to the audio. Value can range from -60 to 0.
  107. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  108. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  109. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  110. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`