add RageSoundManager::AttenuateBuf

This commit is contained in:
Glenn Maynard
2003-10-22 03:39:52 +00:00
parent b5656d7ec9
commit 51d60e1db1
2 changed files with 11 additions and 0 deletions
+10
View File
@@ -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;
+1
View File
@@ -62,6 +62,7 @@ public:
set<RageSound *> 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. */