summaryrefslogtreecommitdiff
path: root/Source/Core/AudioCommon/Mixer.cpp
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2026-01-30 14:51:08 -0500
committerGitHub <noreply@github.com>2026-01-30 14:51:08 -0500
commitb1020186519d690a9b64a215f00da7453ab2803b (patch)
tree9c9e18748e473af95181164acaf2f7fbcf8b5d82 /Source/Core/AudioCommon/Mixer.cpp
parentbb7e01167346d0e3e4bab426a7b87968d715ee5e (diff)
parent51c8f18b73727afaea0991e10789998eaacbe487 (diff)
Merge pull request #14307 from Sam-Belliveau/granular-audio-stretching
Add an option to preserve audio pitch when emulation speed changes
Diffstat (limited to 'Source/Core/AudioCommon/Mixer.cpp')
-rw-r--r--Source/Core/AudioCommon/Mixer.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/Core/AudioCommon/Mixer.cpp b/Source/Core/AudioCommon/Mixer.cpp
index eab73fb17c..0d673a9e0d 100644
--- a/Source/Core/AudioCommon/Mixer.cpp
+++ b/Source/Core/AudioCommon/Mixer.cpp
@@ -71,7 +71,7 @@ void Mixer::MixerFifo::Mix(s16* samples, std::size_t num_samples)
static_cast<double>(FIXED_SAMPLE_RATE_DIVIDEND) / m_input_sample_rate_divisor;
const double emulation_speed = m_mixer->m_config_emulation_speed;
- if (0 < emulation_speed && emulation_speed != 1.0)
+ if (!m_mixer->m_config_audio_preserve_pitch && 0 < emulation_speed && emulation_speed != 1.0)
in_sample_rate *= emulation_speed;
const double base = static_cast<double>(1 << GRANULE_FRAC_BITS);
@@ -430,6 +430,7 @@ void Mixer::StopLogDSPAudio()
void Mixer::RefreshConfig()
{
m_config_emulation_speed = Config::Get(Config::MAIN_EMULATION_SPEED);
+ m_config_audio_preserve_pitch = Config::Get(Config::MAIN_AUDIO_PRESERVE_PITCH);
m_config_fill_audio_gaps = Config::Get(Config::MAIN_AUDIO_FILL_GAPS);
m_config_audio_buffer_ms = Config::Get(Config::MAIN_AUDIO_BUFFER_SIZE);
}