add RageSoundManager::AttenuateBuf
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user