diff --git a/stepmania/src/RageSoundManager.cpp b/stepmania/src/RageSoundManager.cpp index 112bf853cd..819cbc61e8 100644 --- a/stepmania/src/RageSoundManager.cpp +++ b/stepmania/src/RageSoundManager.cpp @@ -262,6 +262,16 @@ void RageSoundManager::SetPrefs(float MixVol) driver->VolumeChanged(); } +void RageSoundManager::AttenuateBuf( Sint16 *buf, int samples, float vol ) +{ + while( samples-- ) + { + *buf = Sint16( (*buf) * vol ); + ++buf; + } +} + + SoundMixBuffer::SoundMixBuffer() { bufsize = used = 0; diff --git a/stepmania/src/RageSoundManager.h b/stepmania/src/RageSoundManager.h index 671022a3f8..204966a9d8 100644 --- a/stepmania/src/RageSoundManager.h +++ b/stepmania/src/RageSoundManager.h @@ -62,6 +62,7 @@ public: set all_sounds; static void MixAudio(Sint16 *dst, const Sint16 *src, Uint32 len, float volume); + static void AttenuateBuf( Sint16 *buf, int samples, float vol ); }; /* This inputs and outputs 16-bit 44khz stereo input. */