summaryrefslogtreecommitdiff
path: root/scene/2d/audio_stream_player_2d.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/2d/audio_stream_player_2d.cpp')
-rw-r--r--scene/2d/audio_stream_player_2d.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/scene/2d/audio_stream_player_2d.cpp b/scene/2d/audio_stream_player_2d.cpp
index 3d9e64ae79..cef473dcdf 100644
--- a/scene/2d/audio_stream_player_2d.cpp
+++ b/scene/2d/audio_stream_player_2d.cpp
@@ -61,7 +61,7 @@ void AudioStreamPlayer2D::_mix_audio() {
for (int j = 0; j < buffer_size; j++) {
- target[j] = buffer[j] * vol;
+ target[j] += buffer[j] * vol;
vol += vol_inc;
}
@@ -76,8 +76,8 @@ void AudioStreamPlayer2D::_mix_audio() {
for (int j = 0; j < buffer_size; j++) {
AudioFrame frame = buffer[j] * vol;
- targets[0][j] = frame;
- targets[1][j] = frame;
+ targets[0][j] += frame;
+ targets[1][j] += frame;
vol += vol_inc;
}
@@ -93,9 +93,9 @@ void AudioStreamPlayer2D::_mix_audio() {
for (int j = 0; j < buffer_size; j++) {
AudioFrame frame = buffer[j] * vol;
- targets[0][j] = frame;
- targets[1][j] = frame;
- targets[2][j] = frame;
+ targets[0][j] += frame;
+ targets[1][j] += frame;
+ targets[2][j] += frame;
vol += vol_inc;
}