summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-10-30 00:09:30 +0100
committerGitHub <noreply@github.com>2018-10-30 00:09:30 +0100
commitf1cb425d9228a063eb464479a69400ff915b9fc1 (patch)
tree2c0cf1ab1c5f145ab634ada958668521c3b81a3e
parentMerge pull request #1613 from ReinUsesLisp/gl-utils (diff)
parenttime_stretch: Switch to values of Citra (diff)
downloadyuzu-f1cb425d9228a063eb464479a69400ff915b9fc1.tar
yuzu-f1cb425d9228a063eb464479a69400ff915b9fc1.tar.gz
yuzu-f1cb425d9228a063eb464479a69400ff915b9fc1.tar.bz2
yuzu-f1cb425d9228a063eb464479a69400ff915b9fc1.tar.lz
yuzu-f1cb425d9228a063eb464479a69400ff915b9fc1.tar.xz
yuzu-f1cb425d9228a063eb464479a69400ff915b9fc1.tar.zst
yuzu-f1cb425d9228a063eb464479a69400ff915b9fc1.zip
-rw-r--r--src/audio_core/time_stretch.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/audio_core/time_stretch.cpp b/src/audio_core/time_stretch.cpp
index cee8b12dd..2fe0b3aef 100644
--- a/src/audio_core/time_stretch.cpp
+++ b/src/audio_core/time_stretch.cpp
@@ -32,10 +32,10 @@ std::size_t TimeStretcher::Process(const s16* in, std::size_t num_in, s16* out,
// We were given actual_samples number of samples, and num_samples were requested from us.
double current_ratio = static_cast<double>(num_in) / static_cast<double>(num_out);
- const double max_latency = 1.0; // seconds
+ const double max_latency = 0.25; // seconds
const double max_backlog = m_sample_rate * max_latency;
const double backlog_fullness = m_sound_touch.numSamples() / max_backlog;
- if (backlog_fullness > 5.0) {
+ if (backlog_fullness > 4.0) {
// Too many samples in backlog: Don't push anymore on
num_in = 0;
}
@@ -49,7 +49,7 @@ std::size_t TimeStretcher::Process(const s16* in, std::size_t num_in, s16* out,
// This low-pass filter smoothes out variance in the calculated stretch ratio.
// The time-scale determines how responsive this filter is.
- constexpr double lpf_time_scale = 2.0; // seconds
+ constexpr double lpf_time_scale = 0.712; // seconds
const double lpf_gain = 1.0 - std::exp(-time_delta / lpf_time_scale);
m_stretch_ratio += lpf_gain * (current_ratio - m_stretch_ratio);