class_audioeffectcompressor.rst 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. .. Generated automatically by doc/tools/makerst.py in Godot's source tree.
  2. .. DO NOT EDIT THIS FILE, but the AudioEffectCompressor.xml source instead.
  3. .. The source is found in doc/classes or modules/<name>/doc_classes.
  4. .. _class_AudioEffectCompressor:
  5. AudioEffectCompressor
  6. =====================
  7. **Inherits:** :ref:`AudioEffect<class_audioeffect>` **<** :ref:`Resource<class_resource>` **<** :ref:`Reference<class_reference>` **<** :ref:`Object<class_object>`
  8. **Category:** Core
  9. Brief Description
  10. -----------------
  11. Adds a Compressor audio effect to an Audio bus.
  12. Reduces sounds that exceed a certain threshold level, smooths out the dynamics and increases the overall volume.
  13. Member Functions
  14. ----------------
  15. +------------------------------+----------------------------------------------------------------------------------------------------------------------+
  16. | :ref:`float<class_float>` | :ref:`get_attack_us<class_AudioEffectCompressor_get_attack_us>` **(** **)** const |
  17. +------------------------------+----------------------------------------------------------------------------------------------------------------------+
  18. | :ref:`float<class_float>` | :ref:`get_gain<class_AudioEffectCompressor_get_gain>` **(** **)** const |
  19. +------------------------------+----------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`float<class_float>` | :ref:`get_mix<class_AudioEffectCompressor_get_mix>` **(** **)** const |
  21. +------------------------------+----------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`float<class_float>` | :ref:`get_ratio<class_AudioEffectCompressor_get_ratio>` **(** **)** const |
  23. +------------------------------+----------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`float<class_float>` | :ref:`get_release_ms<class_AudioEffectCompressor_get_release_ms>` **(** **)** const |
  25. +------------------------------+----------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`String<class_string>` | :ref:`get_sidechain<class_AudioEffectCompressor_get_sidechain>` **(** **)** const |
  27. +------------------------------+----------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`float<class_float>` | :ref:`get_threshold<class_AudioEffectCompressor_get_threshold>` **(** **)** const |
  29. +------------------------------+----------------------------------------------------------------------------------------------------------------------+
  30. | void | :ref:`set_attack_us<class_AudioEffectCompressor_set_attack_us>` **(** :ref:`float<class_float>` attack_us **)** |
  31. +------------------------------+----------------------------------------------------------------------------------------------------------------------+
  32. | void | :ref:`set_gain<class_AudioEffectCompressor_set_gain>` **(** :ref:`float<class_float>` gain **)** |
  33. +------------------------------+----------------------------------------------------------------------------------------------------------------------+
  34. | void | :ref:`set_mix<class_AudioEffectCompressor_set_mix>` **(** :ref:`float<class_float>` mix **)** |
  35. +------------------------------+----------------------------------------------------------------------------------------------------------------------+
  36. | void | :ref:`set_ratio<class_AudioEffectCompressor_set_ratio>` **(** :ref:`float<class_float>` ratio **)** |
  37. +------------------------------+----------------------------------------------------------------------------------------------------------------------+
  38. | void | :ref:`set_release_ms<class_AudioEffectCompressor_set_release_ms>` **(** :ref:`float<class_float>` release_ms **)** |
  39. +------------------------------+----------------------------------------------------------------------------------------------------------------------+
  40. | void | :ref:`set_sidechain<class_AudioEffectCompressor_set_sidechain>` **(** :ref:`String<class_string>` sidechain **)** |
  41. +------------------------------+----------------------------------------------------------------------------------------------------------------------+
  42. | void | :ref:`set_threshold<class_AudioEffectCompressor_set_threshold>` **(** :ref:`float<class_float>` threshold **)** |
  43. +------------------------------+----------------------------------------------------------------------------------------------------------------------+
  44. Member Variables
  45. ----------------
  46. - :ref:`float<class_float>` **attack_us** - Compressor's reaction time when the signal exceeds the threshold. Value can range from 20 to 2000. Default value: [code]20ms[/code].
  47. - :ref:`float<class_float>` **gain** - Gain applied to the output signal.
  48. - :ref:`float<class_float>` **mix** - Balance between original signal and effect signal. Value can range from 0 (totally dry) to 1 (totally wet). Default value: [code]1[/code].
  49. - :ref:`float<class_float>` **ratio** - 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. Default value: [code]4[/code].
  50. - :ref:`float<class_float>` **release_ms** - Compressor's delay time to stop reducing the signal after the signal level falls below the threshold. Value can range from 20 to 2000. Default value: [code]250ms[/code].
  51. - :ref:`String<class_string>` **sidechain** - Reduce the sound level using another audio bus for threshold detection.
  52. - :ref:`float<class_float>` **threshold** - The level above which compression is applied to the audio. Value can range from -60 to 0. Default value: [code]0[/code].
  53. Description
  54. -----------
  55. 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).
  56. Compressor has many uses in the mix:
  57. - In the Master bus to compress the whole output (Although a :ref:`AudioEffectLimiter<class_audioeffectlimiter>` is probably better)
  58. - In voice channels to ensure they sound as balanced as possible.
  59. - Sidechained. Sidechained, which can reduce the sound level sidechained with another audio bus for threshold detection.. This technique is very common in video game mixing to download the level of Music/SFX while voices are being heard.
  60. - Accentuates transients by using a wider attack, making effects sound more punchy.
  61. Member Function Description
  62. ---------------------------
  63. .. _class_AudioEffectCompressor_get_attack_us:
  64. - :ref:`float<class_float>` **get_attack_us** **(** **)** const
  65. .. _class_AudioEffectCompressor_get_gain:
  66. - :ref:`float<class_float>` **get_gain** **(** **)** const
  67. .. _class_AudioEffectCompressor_get_mix:
  68. - :ref:`float<class_float>` **get_mix** **(** **)** const
  69. .. _class_AudioEffectCompressor_get_ratio:
  70. - :ref:`float<class_float>` **get_ratio** **(** **)** const
  71. .. _class_AudioEffectCompressor_get_release_ms:
  72. - :ref:`float<class_float>` **get_release_ms** **(** **)** const
  73. .. _class_AudioEffectCompressor_get_sidechain:
  74. - :ref:`String<class_string>` **get_sidechain** **(** **)** const
  75. .. _class_AudioEffectCompressor_get_threshold:
  76. - :ref:`float<class_float>` **get_threshold** **(** **)** const
  77. .. _class_AudioEffectCompressor_set_attack_us:
  78. - void **set_attack_us** **(** :ref:`float<class_float>` attack_us **)**
  79. .. _class_AudioEffectCompressor_set_gain:
  80. - void **set_gain** **(** :ref:`float<class_float>` gain **)**
  81. .. _class_AudioEffectCompressor_set_mix:
  82. - void **set_mix** **(** :ref:`float<class_float>` mix **)**
  83. .. _class_AudioEffectCompressor_set_ratio:
  84. - void **set_ratio** **(** :ref:`float<class_float>` ratio **)**
  85. .. _class_AudioEffectCompressor_set_release_ms:
  86. - void **set_release_ms** **(** :ref:`float<class_float>` release_ms **)**
  87. .. _class_AudioEffectCompressor_set_sidechain:
  88. - void **set_sidechain** **(** :ref:`String<class_string>` sidechain **)**
  89. .. _class_AudioEffectCompressor_set_threshold:
  90. - void **set_threshold** **(** :ref:`float<class_float>` threshold **)**