From e0edb80016951be6edcc51c5a218588938977508 Mon Sep 17 00:00:00 2001 From: BlackMark Date: Sun, 12 Jul 2026 09:37:10 +0200 Subject: [PATCH] Drop the last game-name anecdote from a hook comment Generalize the rate-guess rationale in audio_hook.cpp to describe the non-device-rate scenario without naming specific games; comment-only. --- hook/src/audio_hook.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/hook/src/audio_hook.cpp b/hook/src/audio_hook.cpp index e54bd7e..e8d5838 100644 --- a/hook/src/audio_hook.cpp +++ b/hook/src/audio_hook.cpp @@ -142,13 +142,12 @@ std::atomic g_frames_silenced{0}; // total frames whose local pla // When we attach to an already-running game we never saw its IAudioClient::Initialize, // so a render client discovered on the hot path gets the device mix format as a best -// guess. That guess is wrong for games that render at a non-device rate via WASAPI -// AUTOCONVERTPCM -- e.g. Godot/Brotato render 44100 while the device mixes at 48000, so -// playing the captured 44100 audio back as 48000 shifts the pitch up. For such streams we -// verify (and correct) the guessed sample rate by measuring the real render cadence -// before publishing the format. g_stream_rate_guess marks a guessed stream; g_rate_estimator -// is its robust, consensus-based measurement (see rate_estimator.hpp). Both guarded by -// g_setup_mutex. +// guess. That guess is wrong for a game that renders at a non-device rate via WASAPI +// AUTOCONVERTPCM (e.g. rendering 44100 while the device mixes at 48000), so playing the +// captured 44100 audio back as 48000 shifts the pitch up. For such streams we verify (and +// correct) the guessed sample rate by measuring the real render cadence before publishing +// the format. g_stream_rate_guess marks a guessed stream; g_rate_estimator is its robust, +// consensus-based measurement (see rate_estimator.hpp). Both guarded by g_setup_mutex. bool g_stream_rate_guess[kMaxAudioStreams] = {}; RateEstimator g_rate_estimator[kMaxAudioStreams] = {};