summaryrefslogtreecommitdiff
path: root/servers
diff options
context:
space:
mode:
Diffstat (limited to 'servers')
-rw-r--r--servers/audio/audio_stream.cpp4
-rw-r--r--servers/audio/effects/audio_effect_reverb.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/servers/audio/audio_stream.cpp b/servers/audio/audio_stream.cpp
index b207c5f4db..0ad30987e7 100644
--- a/servers/audio/audio_stream.cpp
+++ b/servers/audio/audio_stream.cpp
@@ -46,9 +46,9 @@ void AudioStreamPlaybackResampled::_begin_resample() {
void AudioStreamPlaybackResampled::mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames) {
- float target_rate = AudioServer::get_singleton()->get_mix_rate() * p_rate_scale;
+ float target_rate = AudioServer::get_singleton()->get_mix_rate();
- uint64_t mix_increment = uint64_t((get_stream_sampling_rate() / double(target_rate)) * double(FP_LEN));
+ uint64_t mix_increment = uint64_t(((get_stream_sampling_rate() * p_rate_scale) / double(target_rate)) * double(FP_LEN));
for (int i = 0; i < p_frames; i++) {
diff --git a/servers/audio/effects/audio_effect_reverb.cpp b/servers/audio/effects/audio_effect_reverb.cpp
index 204b11746c..162c0a1445 100644
--- a/servers/audio/effects/audio_effect_reverb.cpp
+++ b/servers/audio/effects/audio_effect_reverb.cpp
@@ -96,7 +96,7 @@ void AudioEffectReverb::set_predelay_msec(float p_msec) {
void AudioEffectReverb::set_predelay_feedback(float p_feedback) {
- predelay_fb = p_feedback;
+ predelay_fb = CLAMP(p_feedback, 0, 0.98);
}
void AudioEffectReverb::set_room_size(float p_size) {
@@ -185,7 +185,7 @@ void AudioEffectReverb::_bind_methods() {
ADD_GROUP("Predelay", "predelay_");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "predelay_msec", PROPERTY_HINT_RANGE, "20,500,1"), "set_predelay_msec", "get_predelay_msec");
- ADD_PROPERTY(PropertyInfo(Variant::REAL, "predelay_feedback", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_predelay_feedback", "get_predelay_feedback");
+ ADD_PROPERTY(PropertyInfo(Variant::REAL, "predelay_feedback", PROPERTY_HINT_RANGE, "0,0.98,0.01"), "set_predelay_feedback", "get_predelay_feedback");
ADD_GROUP("", "");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "room_size", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_room_size", "get_room_size");
ADD_PROPERTY(PropertyInfo(Variant::REAL, "damping", PROPERTY_HINT_RANGE, "0,1,0.01"), "set_damping", "get_damping");