Square the master volume so it is more perceptually linear.

This commit is contained in:
Colby Klein
2019-03-15 18:35:45 -07:00
parent 996b69cb01
commit 9074fc09f1
+4 -1
View File
@@ -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();