Audio: Set overall volume of OpenAL output to 0.8

This commit is contained in:
Jonas Kulla 2014-12-23 20:12:47 +01:00
parent 4b08d82ea4
commit 4560589e25
3 changed files with 3 additions and 2 deletions

View File

@ -238,5 +238,6 @@ inline ALenum chooseALFormat(int sampleSize, int channelCount)
#define AUDIO_SLEEP 10
#define STREAM_BUF_SIZE 32768
#define GLOBAL_VOLUME 0.8
#endif // ALUTIL_H

View File

@ -252,7 +252,7 @@ float AudioStream::playingOffset()
void AudioStream::updateVolume()
{
float vol = 1.0;
float vol = GLOBAL_VOLUME;
for (size_t i = 0; i < VolumeTypeCount; ++i)
vol *= volumes[i];

View File

@ -168,7 +168,7 @@ void SoundEmitter::play(const std::string &filename,
if (switchBuffer)
AL::Source::attachBuffer(src, buffer->alBuffer);
AL::Source::setVolume(src, _volume);
AL::Source::setVolume(src, _volume * GLOBAL_VOLUME);
AL::Source::setPitch(src, _pitch);
AL::Source::play(src);