Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

AudioEffectLimiter

已弃用: Use AudioEffectHardLimiter instead.

继承: AudioEffect < Resource < RefCounted < Object

向音频总线添加一个软削波限制器音频效果。

描述

“限制器”是一种旨在防止音频信号超过特定的音量阈值电平的音频效果,其工作原理通常是通过降低音量或对音频进行“软削波”来实现的。强烈建议在主总线上添加一个限制器,以防止当音量超过 0 分贝时发生削波。

软削波会在音量阈值以下略微降低峰值,并随着输入音量的增加而逐渐增强其效果,从而使峰值永远不会超过阈值电平。

如果需要硬削波,请考虑 AudioEffectDistortion.MODE_CLIP

教程

属性

float

ceiling_db

-0.1

float

soft_clip_db

2.0

float

soft_clip_ratio

10.0

float

threshold_db

0.0


属性说明

float ceiling_db = -0.1 🔗

  • void set_ceiling_db(value: float)

  • float get_ceiling_db()

波形的最大允许值,单位是分贝。数值范围从 -20 到 -0.1。


float soft_clip_db = 2.0 🔗

  • void set_soft_clip_db(value: float)

  • float get_soft_clip_db()

调整受限波形的音量,单位为分贝。取值范围为 0 到 6。


float soft_clip_ratio = 10.0 🔗

  • void set_soft_clip_ratio(value: float)

  • float get_soft_clip_ratio()

该属性对音频无效。由于该限制器效果已被弃用,请改用 AudioEffectHardLimiter


float threshold_db = 0.0 🔗

  • void set_threshold_db(value: float)

  • float get_threshold_db()

限制器开始生效的音量阈值电平,单位为分贝。取值范围为 -30 到 0。