From 9074fc09f12cf7cde3b734e6ae2cb43ce3a3e2f1 Mon Sep 17 00:00:00 2001 From: Colby Klein Date: Fri, 15 Mar 2019 18:35:45 -0700 Subject: [PATCH] Square the master volume so it is more perceptually linear. --- src/RageSoundReader_PostBuffering.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/RageSoundReader_PostBuffering.cpp b/src/RageSoundReader_PostBuffering.cpp index 2d7a124d55..cda6219435 100644 --- a/src/RageSoundReader_PostBuffering.cpp +++ b/src/RageSoundReader_PostBuffering.cpp @@ -31,7 +31,10 @@ int RageSoundReader_PostBuffering::Read( float *pBuf, int iFrames ) // Combine the sound's volume with master volume. g_Mutex.Lock(); - float fVolume = m_fVolume * g_fMasterVolume; + + // Square the master so lower volumes are more sensitive. + // This lines up better with perceived volume. + float fVolume = m_fVolume * g_fMasterVolume * g_fMasterVolume; fVolume = clamp( fVolume, 0, 1 ); g_Mutex.Unlock();