diff options
author | David Marcec <dmarcecguzman@gmail.com> | 2020-04-22 06:36:08 +0200 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2020-05-11 18:56:15 +0200 |
commit | 16c0373adc5bd76db97d5d2231e80463dda242dd (patch) | |
tree | 9caeed77e293c12cbecf18d759dd8a4e19ba08a5 | |
parent | pass by const ref instead (diff) | |
download | yuzu-16c0373adc5bd76db97d5d2231e80463dda242dd.tar yuzu-16c0373adc5bd76db97d5d2231e80463dda242dd.tar.gz yuzu-16c0373adc5bd76db97d5d2231e80463dda242dd.tar.bz2 yuzu-16c0373adc5bd76db97d5d2231e80463dda242dd.tar.lz yuzu-16c0373adc5bd76db97d5d2231e80463dda242dd.tar.xz yuzu-16c0373adc5bd76db97d5d2231e80463dda242dd.tar.zst yuzu-16c0373adc5bd76db97d5d2231e80463dda242dd.zip |
-rw-r--r-- | src/audio_core/audio_renderer.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/audio_core/audio_renderer.cpp b/src/audio_core/audio_renderer.cpp index fc6e70f6b..50846a854 100644 --- a/src/audio_core/audio_renderer.cpp +++ b/src/audio_core/audio_renderer.cpp @@ -315,8 +315,8 @@ void AudioRenderer::VoiceState::RefreshBuffer(Core::Memory::Memory& memory, sample *= voice_resources[0]->mix_volumes[0]; } - samples[index * 2] = static_cast<s16>(sample); - samples[index * 2 + 1] = static_cast<s16>(sample); + samples[index * 2] = static_cast<s16>(sample * info.volume); + samples[index * 2 + 1] = static_cast<s16>(sample * info.volume); } break; } @@ -336,11 +336,11 @@ void AudioRenderer::VoiceState::RefreshBuffer(Core::Memory::Memory& memory, } if (voice_resources[1]->in_use) { - sample_l *= voice_resources[1]->mix_volumes[1]; + sample_r *= voice_resources[1]->mix_volumes[1]; } - samples[index_l] = static_cast<s16>(sample_l); - samples[index_r] = static_cast<s16>(sample_r); + samples[index_l] = static_cast<s16>(sample_l * info.volume); + samples[index_r] = static_cast<s16>(sample_r * info.volume); } break; } @@ -371,8 +371,10 @@ void AudioRenderer::VoiceState::RefreshBuffer(Core::Memory::Memory& memory, BR *= voice_resources[5]->mix_volumes[5]; } - samples[index * 2] = static_cast<s16>(0.3694f * FL + 0.2612f * FC + 0.3694f * BL); - samples[index * 2 + 1] = static_cast<s16>(0.3694f * FR + 0.2612f * FC + 0.3694f * BR); + samples[index * 2] = + static_cast<s16>((0.3694f * FL + 0.2612f * FC + 0.3694f * BL) * info.volume); + samples[index * 2 + 1] = + static_cast<s16>((0.3694f * FR + 0.2612f * FC + 0.3694f * BR) * info.volume); } break; } |