Browse Source

Merge pull request #2059 from FearlessTobi/port-4601

Port citra-emu/citra#4601: "dsp_interface: fix sound being played while volume is 0"
pull/15/merge
bunnei 7 years ago
committed by GitHub
parent
commit
6957bac03c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/audio_core/stream.cpp

2
src/audio_core/stream.cpp

@ -68,7 +68,7 @@ static void VolumeAdjustSamples(std::vector<s16>& samples) {
} }
// Implementation of a volume slider with a dynamic range of 60 dB // Implementation of a volume slider with a dynamic range of 60 dB
const float volume_scale_factor{std::exp(6.90775f * volume) * 0.001f};
const float volume_scale_factor = volume == 0 ? 0 : std::exp(6.90775f * volume) * 0.001f;
for (auto& sample : samples) { for (auto& sample : samples) {
sample = static_cast<s16>(sample * volume_scale_factor); sample = static_cast<s16>(sample * volume_scale_factor);
} }

Loading…
Cancel
Save