mirror of
https://github.com/godotengine/godot
synced 2024-09-05 05:48:29 +00:00
Fix AudioStreamRandomizer.random_volume_offset_db not working
This commit is contained in:
parent
37ee293be8
commit
34eba41aea
|
@ -810,7 +810,11 @@ void AudioStreamPlaybackRandomizer::tag_used_streams() {
|
|||
|
||||
int AudioStreamPlaybackRandomizer::mix(AudioFrame *p_buffer, float p_rate_scale, int p_frames) {
|
||||
if (playing.is_valid()) {
|
||||
return playing->mix(p_buffer, p_rate_scale * pitch_scale, p_frames);
|
||||
int mixed_samples = playing->mix(p_buffer, p_rate_scale * pitch_scale, p_frames);
|
||||
for (int samp = 0; samp < mixed_samples; samp++) {
|
||||
p_buffer[samp] *= volume_scale;
|
||||
}
|
||||
return mixed_samples;
|
||||
} else {
|
||||
for (int i = 0; i < p_frames; i++) {
|
||||
p_buffer[i] = AudioFrame(0, 0);
|
||||
|
|
Loading…
Reference in a new issue