summaryrefslogtreecommitdiff
path: root/scene/resources
diff options
context:
space:
mode:
authorMichael Alexsander <michaelalexsander@protonmail.com>2020-11-04 17:03:12 -0300
committerMichael Alexsander <michaelalexsander@protonmail.com>2020-11-04 17:03:54 -0300
commit04ebe4e7a4e6746d7ca586c2243580ee12bbd245 (patch)
tree66911451daae04dd0d9940a76d36ba4c6b315079 /scene/resources
parent8e13b93bf78e4440e2012cec4940b8e3318daac1 (diff)
Fix WAV resources ignoring the AudioServer's 'global_rate_scale' value
Diffstat (limited to 'scene/resources')
-rw-r--r--scene/resources/audio_stream_sample.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/scene/resources/audio_stream_sample.cpp b/scene/resources/audio_stream_sample.cpp
index f02e7987a9..600a859894 100644
--- a/scene/resources/audio_stream_sample.cpp
+++ b/scene/resources/audio_stream_sample.cpp
@@ -261,7 +261,8 @@ void AudioStreamPlaybackSample::mix(AudioFrame *p_buffer, float p_rate_scale, in
sign = -1;
}
- float base_rate = AudioServer::get_singleton()->get_mix_rate();
+ float global_rate_scale = AudioServer::get_singleton()->get_global_rate_scale();
+ float base_rate = AudioServer::get_singleton()->get_mix_rate() * global_rate_scale;
float srate = base->mix_rate;
srate *= p_rate_scale;
float fincrement = srate / base_rate;